# Forecasts Latest Updates

> Use the following API endpoints to obtain the latest updates on forecast data.

Source: https://docs.tradingeconomics.com/forecasts/updates/

List all forecast updates with their related country, category, and ticker.

**PYTHON**
*Using Requests:*
```python
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/forecast/updates?c={your_api_key}'
data = requests.get(url).json()
print(data)
```
*Or using our package:*
```python
import tradingeconomics as te
te.login('your_api_key')
te.getForecastUpdates()
```

**JS**
*Using Requests:*
```js
const axios = require('axios');
(async () => {
    const your_api_key = 'your_api_key'
    const response = await axios.get(`https://api.tradingeconomics.com/forecast/updates?c=${your_api_key}`)
    console.log(response.data)
})()
```
*Or using our package:*
```javascript
const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getForecastsUpdates().then(function(data){
    console.log(data)     
});
```

**C#**
*Using Requests:*
```c#
using (var httpClient = new HttpClient())
{
    using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/forecast/updates?c=your_api_key"))
    {
        request.Headers.TryAddWithoutValidation("Upgrade-Insecure-Requests", "1");
        var response = await httpClient.SendAsync(request);
        if (response.IsSuccessStatusCode)
        {
            var content = await response.Content.ReadAsStringAsync(); 
            Console.WriteLine(content);
        }
    }
}
```

The response data format can be configured by appending the **&f=** parameter to the URL request.

**JSON**
```text
https://api.tradingeconomics.com/forecasts/updates?c={your_api_key}&f=json
```
```json
[
  {
    "Country": "Albania",
    "Category": "CPI Transportation",
    "Ticker": "ALBANIACPITRA",
    "LastUpdate": "2024-12-02T18:15:00"
  },
  {
    "Country": "Albania",
    "Category": "Gasoline Prices",
    "Ticker": "AlbaniaGasPri",
    "LastUpdate": "2024-12-02T18:15:00"
  },
  {
    "Country": "Angola",
    "Category": "CPI Transportation",
    "Ticker": "ANGOLACPITRA",
    "LastUpdate": "2024-12-02T18:15:00"
  }
]
```

**CSV**
```text
https://api.tradingeconomics.com/forecasts/updates?c={your_api_key}&f=csv
```
```bash
Country,Category,Ticker,LastUpdate
Albania	CPI Transportation	ALBANIACPITRA	12/2/2024 6:15:00 PM
Albania	Gasoline Prices	AlbaniaGasPri	12/2/2024 6:15:00 PM
Angola	CPI Transportation	ANGOLACPITRA	12/2/2024 6:15:00 PM

```

**HTML**
```text
https://api.tradingeconomics.com/forecasts/updates?c={your_api_key}
```

| Country | Category | Ticker | LastUpdate |
|-------|-------|-------|-------|
| Albania | CPI Transportation	| ALBANIACPITRA	| 12/2/2024 6:15:00 PM |
| Albania | Gasoline Prices	| AlbaniaGasPri | 12/2/2024 6:15:00 PM
| Angola | CPI Transportation | ANGOLACPITRA | 12/2/2024 6:15:00 PM |

## By date

**PYTHON**
*Using Requests:*
```python
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/forecast/updates?start_date=2024-10-30&c={your_api_key}'
data = requests.get(url).json()
print(data)
```
*Or using our package:*
```python
te.getForecastUpdates(init_date = '2024-10-30')
```

**JS**
*Using Requests:*
```js
const axios = require('axios');
(async () => {
    const your_api_key = 'your_api_key'
    const response = await axios.get(`https://api.tradingeconomics.com/forecast/updates?start_date=2024-10-30&c=${your_api_key}`)
    console.log(response.data)
})()
```
*Or using our package:*
```javascript

data = te.getForecastsUpdates(start_date = '2024-10-30').then(function(data){
    console.log(data)     
});
```

**C#**
*Using Requests:*
```c#
    new HttpMethod("GET"), "https://api.tradingeconomics.com/forecast/updates?start_date=2024-10-30&c=your_api_key"
```

The response data format can be configured by appending the **&f=** parameter to the URL request.

**JSON**
```text
https://api.tradingeconomics.com/forecasts/updates?c={your_api_key}&start_date={yyyy-mm-dd}&f=json
```
```json
[
  {
    "Country": "Albania",
    "Category": "CPI Transportation",
    "Ticker": "ALBANIACPITRA",
    "LastUpdate": "2024-12-02T18:15:00"
  },
  {
    "Country": "Albania",
    "Category": "Gasoline Prices",
    "Ticker": "AlbaniaGasPri",
    "LastUpdate": "2024-12-02T18:15:00"
  },
  {
    "Country": "Angola",
    "Category": "CPI Transportation",
    "Ticker": "ANGOLACPITRA",
    "LastUpdate": "2024-12-02T18:15:00"
  }
]
```

**CSV**
```text
https://api.tradingeconomics.com/forecasts/updates?c={your_api_key}&start_date={yyyy-mm-dd}&f=csv
```
```bash
Country,Category,Ticker,LastUpdate
Albania	CPI Transportation	ALBANIACPITRA	12/2/2024 6:15:00 PM
Albania	Gasoline Prices	AlbaniaGasPri	12/2/2024 6:15:00 PM
Angola	CPI Transportation	ANGOLACPITRA	12/2/2024 6:15:00 PM

```

**HTML**
```text
https://api.tradingeconomics.com/forecasts/updates?c={your_api_key}&start_date={yyyy-mm-dd}
```

| Country | Category | Ticker | LastUpdate |
|-------|-------|-------|-------|
| Albania | CPI Transportation	| ALBANIACPITRA	| 12/2/2024 6:15:00 PM |
| Albania | Gasoline Prices	| AlbaniaGasPri | 12/2/2024 6:15:00 PM
| Angola | CPI Transportation | ANGOLACPITRA | 12/2/2024 6:15:00 PM |

## By country

**PYTHON**
*Using Requests:*
```python
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/forecast/updates?country=albania&c={your_api_key}'
data = requests.get(url).json()
print(data)
```
*Or using our package:*
```python
te.getForecastUpdates(country = 'albania')
```

**JS**
*Using Requests:*
```js
const axios = require('axios');
(async () => {
    const your_api_key = 'your_api_key'
    const response = await axios.get(`https://api.tradingeconomics.com/forecast/updates?country=albania&c=${your_api_key}`)
    console.log(response.data)
})()
```
*Or using our package:*
```javascript

data = te.getForecastsUpdates(country = 'albania').then(function(data){
    console.log(data)     
});
```

**C#**
*Using Requests:*
```c#
    new HttpMethod("GET"), "https://api.tradingeconomics.com/forecast/updates?country=albania&c=your_api_key"
```

The response data format can be configured by appending the **&f=** parameter to the URL request.

**JSON**
```text
https://api.tradingeconomics.com/forecasts/updates?c={your_api_key}&country={country}&f=json
```
```json
[
  {
    "Country": "Albania",
    "Category": "CPI Transportation",
    "Ticker": "ALBANIACPITRA",
    "LastUpdate": "2024-12-02T18:15:00"
  },
  {
    "Country": "Albania",
    "Category": "Gasoline Prices",
    "Ticker": "AlbaniaGasPri",
    "LastUpdate": "2024-12-02T18:15:00"
  },
  {
    "Country": "Angola",
    "Category": "CPI Transportation",
    "Ticker": "ANGOLACPITRA",
    "LastUpdate": "2024-12-02T18:15:00"
  }
]
```

**CSV**
```text
https://api.tradingeconomics.com/forecasts/updates?c={your_api_key}&country={country}&f=csv
```
```bash
Country,Category,Ticker,LastUpdate
Albania	CPI Transportation	ALBANIACPITRA	12/2/2024 6:15:00 PM
Albania	Gasoline Prices	AlbaniaGasPri	12/2/2024 6:15:00 PM
Angola	CPI Transportation	ANGOLACPITRA	12/2/2024 6:15:00 PM

```

**HTML**
```text
https://api.tradingeconomics.com/forecasts/updates?c={your_api_key}&country={country}
```

| Country | Category | Ticker | LastUpdate |
|-------|-------|-------|-------|
| Albania | CPI Transportation	| ALBANIACPITRA	| 12/2/2024 6:15:00 PM |
| Albania | Gasoline Prices	| AlbaniaGasPri | 12/2/2024 6:15:00 PM
| Angola | CPI Transportation | ANGOLACPITRA | 12/2/2024 6:15:00 PM |

## Response fields

| Field           | Type   | Description                                        | Example                |
| ----------------| -------|----------------------------------------------------|------------------------|
| Country         | string | Name of the country associated with the indicator.                          | "Albania"              |
| Category	      | string | Name of the economic indicator.                 | "CPI Transportations"  |
| Ticker	      | string | Unique ticker used by Trading Economics            | "ANGOLACPITRA"         |
| LastUpdate      | string | Timestamp of the most recent update to the data (insert or change), in UTC. | "12/2/2024 6:15:00 PM" |

