CreateNewForecast

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

Attention.

Disabled method. Use version 5 of the API.

For information about the compatibility of methods between versions 4 and 5, see the Migration guide.

For a method, there is a version of CreateNewForecast (Live).

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 method) and download the report (using the GetForecast 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. Reports are stored on the server for five hours, then deleted automatically. Use the DeleteForecastReport method to delete a report manually.

Input data

The input data structure in JSON is shown below.

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

Parameters are described below.

Parameter Description Required
NewForecastInfo object
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. 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.
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 method.

No
Parameter Description Required
NewForecastInfo object
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. 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.
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 method.

No

Output data

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

{
   "data": 137456
}

Examples of input data

Python

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

PHP

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

Perl

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