---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.ru/dev/direct/doc/dg-v4/en/reference/CreateNewForecast.md
  - https://yandex.ru/dev/direct/doc/dg-v4/ru/reference/CreateNewForecast.md
  - href: en/reference/CreateNewForecast.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/direct/doc/dg-v4/en/llms.txt

# CreateNewForecast
Generates a forecast on the server for impressions, clicks and expenses.

{% note alert %}

Disabled method. Use version 5 of the API.

For information about the compatibility of methods between versions 4 and 5, see the [Migration guide](https://yandex.com/dev/direct/doc/migration/concepts/methods.md).

{% endnote %}


For a method, there is a version of [CreateNewForecast (Live)](https://yandex.ru/dev/direct/doc/dg-v4/en/live/CreateNewForecast.md).

The method returns the ID of the future report. You can use the ID to find out whether the report is ready (using the [GetForecastList](https://yandex.ru/dev/direct/doc/dg-v4/en/reference/GetForecastList.md) method) and download the report (using the [GetForecast](https://yandex.ru/dev/direct/doc/dg-v4/en/reference/GetForecast.md) method). The average time for generating a report is up to a minute.

## Restrictions

For a single user, no more than five reports are stored on the server. On an attempt to create a sixth report, an error message is returned with error code [31](https://yandex.ru/dev/direct/doc/dg-v4/en/reference/ErrorCodes.md#ErrorCode31). Reports are stored on the server for five hours, then deleted automatically. Use the [DeleteForecastReport](https://yandex.ru/dev/direct/doc/dg-v4/en/reference/DeleteForecastReport.md) method to delete a report manually.


## Input data {#input}

The input data structure in JSON is shown below.

```javascript
{
   "method": "CreateNewForecast",
   "param": {
      /* NewForecastInfo */
      "Phrases": [
         (string)
         ...
      ],
      "Categories": [
         (int)
         ...
      ],
      "GeoID": [
         (int)
         ...
      ]
   }
}
```

Parameters are described below.


#|
||
**<sup >Parameter</sup>**
|
**<sup >Description</sup>**
|
**<sup >Required</sup>**
||

||
**<sub >NewForecastInfo object</sub>**
||
||
`Phrases`
|
Array of keywords that you need to get a forecast for (no more than 100 keywords, using UTF-8 encoding).

Keywords may contain negative keywords. A negative keyword that consists of multiple words should be enclosed in parentheses. For example:

_refrigerator -cooler -(refrigeration equipment) -repair_.


{% note info %}

If the array contains overlapping keywords (meaning they match the same search query), the forecasted ad display and click might be associated with any of these keywords at random. So the forecast for these keywords might differ from the forecast that is received for each of the keywords via separate method calls. See section [Eliminating intersections](https://yandex.ru/dev/direct/doc/dg-v4/en/concepts/targeting.md#uniqness).

{% endnote %}
|
Yes
||
||
`Categories`
|
Array containing IDs of Yandex Catalog categories. This parameter is not used, and the passed value is ignored.
|
No
||
||
`GeoID`
|
Array containing IDs of the regions to create a forecast for. If omitted, the forecast is put together for all regions.

To get a list of regions, use the [GetRegions](https://yandex.ru/dev/direct/doc/dg-v4/en/reference/GetRegions.md) method.
|
No
||
|#


## Output data {#output}

The method returns the ID of the future report, as shown in the following example.

```javascript
{
   "data": 137456
}
```


## Examples of input data {#example}

## Python

```python
{
   'Phrases': [u'refrigerator -unit', u'refrigeration unit'],
   'GeoID': [213]
}
```

## PHP

```php
array(
   'Phrases' => array('nokia', 'phone', 'cars'),
   'GeoID' => array(213)
)
```

## Perl

```perl
{
   'Phrases' => ['nokia', 'phone', 'cars'],
}
```

