Authentication with the API v1
Written by
Updated at November 20, 2024
To work with Search API using API v1, you need to send API requests on behalf of a service account. API v1 only supports authentication with API keys.
Warning
If your API key may have been compromised, revoke it and issue a new one.
-
Provide the obtained values in each request:
GET requestsPOST requestsIn GET requests, provide the folder ID and API key values in the
folderid
andapikey
fields of the request URL, respectively:curl 'https://yandex.<domain>/search/xml?folderid=<folder_ID>&apikey=<API_key_value>&query=<search_request_text>'
In POST requests, provide the API key value in the
Authorization
request header in the following format:curl \ --request POST \ --header "Authorization: Api-Key <API_key>" \ ...
Provide the folder ID to the request URL in the
folderid
field:https://yandex.<domain>/search/xml?folderid=<folder_ID>