Data API / DataForSEO / SERP
Setting Google AI Mode SERP Tasks
Queues Google's AI Mode answer for a query, with the sources it cites on Google, returning a task id in tasks[0].id. Wrapped in DataForSEO's envelope: data in tasks[0].result, outcome in tasks[0].status_code - a rejected request still returns HTTP 200. The live twin answers immediately and is simpler for a single query; queue when the batch would outlast a tool call.
Параметры
Параметров пути, запроса и заголовков нет.
Тело запроса
keywordstringОбязательныйKeyword; you can specify up to 700 characters
location_codeintegerНеобязательныйSearch engine location code; required if location_name or location_coordinate is not specified
location_namestringНеобязательныйFull name of search engine location; required if location_code or location_coordinate is not specified
location_coordinatestringНеобязательныйGPS coordinates of a location; required if location_name or location_code is not specified
language_namestringНеобязательныйFull name of search engine language; required if language_code is not specified
language_codestringНеобязательныйSearch engine language code; required if language_name is not specified
priorityintegerНеобязательныйTask priority: 1 normal (default), 2 high
devicestringНеобязательныйDevice type: desktop or mobile
pingback_urlstringНеобязательныйNotification URL of a completed task
postback_urlstringНеобязательныйURL for sending task results
postback_datastringНеобязательныйPostback URL datatype; required if postback_url is specified; possible values: advanced, html
Пример запроса
curl -X POST "https://openapi.felo.ai/v1/beta/dataforseo/serp/google/ai_mode/task_post" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"keyword": "<string>",
"location_code": 0,
"location_name": "<string>",
"location_coordinate": "<string>",
"language_name": "<string>",
"language_code": "<string>",
"priority": 0,
"device": "<string>"
}'Ответ
Поля ответа
versionstringНеобязательныйThe current version of the API
status_codeintegerНеобязательныйGeneral status code
status_messagestringНеобязательныйGeneral informational message
timestringНеобязательныйExecution time, seconds
costnumberНеобязательныйTotal tasks cost, USD
tasks_countintegerНеобязательныйThe number of tasks in the tasks array
tasks_errorintegerНеобязательныйThe number of tasks in the tasks array returned with an error
tasksstring[]НеобязательныйArray of task objects
idstringНеобязательныйTask identifier in UUID format
status_codeintegerНеобязательныйTask status code
status_messagestringНеобязательныйTask status message
costnumberНеобязательныйCost of the task, USD
result_countintegerНеобязательныйNumber of elements in the result array