Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-access
<?php // You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip require('RestClient.php'); $api_url = 'https://api.dataforseo.com/'; // Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access $client = new RestClient($api_url, null, 'login', 'password'); try { // using this method you can get a list of locations and languages // GET /v3/keywords_data/bing/search_volume_history/locations_and_languages // the full list of possible parameters is available in documentation $result = $client->get('/v3/keywords_data/bing/search_volume_history/locations_and_languages'); print_r($result); // do something with result } catch (RestClientException $e) { echo "\n"; print "HTTP code: {$e->getHttpCode()}\n"; print "Error code: {$e->getCode()}\n"; print "Message: {$e->getMessage()}\n"; print $e->getTraceAsString(); echo "\n"; } $client = null; ?>
The above command returns JSON structured like this:
{ "version": "0.1.20240626", "status_code": 20000, "status_message": "Ok.", "time": "0.1915 sec.", "cost": 0, "tasks_count": 1, "tasks_error": 0, "tasks": [ { "id": "07101353-1535-0258-0000-88c7539cbdfc", "status_code": 20000, "status_message": "Ok.", "time": "0.1074 sec.", "cost": 0, "result_count": 12, "path": [ "v3", "keywords_data", "bing", "search_volume_history", "locations_and_languages" ], "data": { "api": "keywords_data", "function": "locations_and_languages", "se": "bing", "se_type": "search_volume_history" }, "result": [ { "language_name": "Danish", "language_code": "da", "available_locations": [ { "location_code": 2208, "location_name": "Denmark", "country_iso_code": "DK", "location_type": "Country" } ] }, { "language_name": "Dutch", "language_code": "nl", "available_locations": [ { "location_code": 2528, "location_name": "Netherlands", "country_iso_code": "NL", "location_type": "Country" } ] }, { "language_name": "English", "language_code": "en", "available_locations": [ { "location_code": 2036, "location_name": "Australia", "country_iso_code": "AU", "location_type": "Country" }, { "location_code": 2124, "location_name": "Canada", "country_iso_code": "CA", "location_type": "Country" }, { "location_code": 2356, "location_name": "India", "country_iso_code": "IN", "location_type": "Country" }, { "location_code": 2360, "location_name": "Indonesia", "country_iso_code": "ID", "location_type": "Country" }, { "location_code": 2372, "location_name": "Ireland", "country_iso_code": "IE", "location_type": "Country" }, { "location_code": 2458, "location_name": "Malaysia", "country_iso_code": "MY", "location_type": "Country" }, { "location_code": 2554, "location_name": "New Zealand", "country_iso_code": "NZ", "location_type": "Country" }, { "location_code": 2608, "location_name": "Philippines", "country_iso_code": "PH", "location_type": "Country" }, { "location_code": 2702, "location_name": "Singapore", "country_iso_code": "SG", "location_type": "Country" }, { "location_code": 2764, "location_name": "Thailand", "country_iso_code": "TH", "location_type": "Country" }, { "location_code": 2826, "location_name": "United Kingdom", "country_iso_code": "GB", "location_type": "Country" }, { "location_code": 2840, "location_name": "United States", "country_iso_code": "US", "location_type": "Country" }, { "location_code": 2704, "location_name": "Vietnam", "country_iso_code": "VN", "location_type": "Country" } ] }, { "language_name": "Finnish", "language_code": "fi", "available_locations": [ { "location_code": 2246, "location_name": "Finland", "country_iso_code": "FI", "location_type": "Country" } ] }, { "language_name": "French", "language_code": "fr", "available_locations": [ { "location_code": 2124, "location_name": "Canada", "country_iso_code": "CA", "location_type": "Country" }, { "location_code": 2250, "location_name": "France", "country_iso_code": "FR", "location_type": "Country" }, { "location_code": 2756, "location_name": "Switzerland", "country_iso_code": "CH", "location_type": "Country" } ] }, { "language_name": "German", "language_code": "de", "available_locations": [ { "location_code": 2040, "location_name": "Austria", "country_iso_code": "AT", "location_type": "Country" }, { "location_code": 2276, "location_name": "Germany", "country_iso_code": "DE", "location_type": "Country" }, { "location_code": 2756, "location_name": "Switzerland", "country_iso_code": "CH", "location_type": "Country" } ] }, { "language_name": "Italian", "language_code": "it", "available_locations": [ { "location_code": 2380, "location_name": "Italy", "country_iso_code": "IT", "location_type": "Country" } ] }, { "language_name": "Spanish", "language_code": "es", "available_locations": [ { "location_code": 2032, "location_name": "Argentina", "country_iso_code": "AR", "location_type": "Country" }, { "location_code": 2152, "location_name": "Chile", "country_iso_code": "CL", "location_type": "Country" }, { "location_code": 2170, "location_name": "Colombia", "country_iso_code": "CO", "location_type": "Country" }, { "location_code": 2484, "location_name": "Mexico", "country_iso_code": "MX", "location_type": "Country" }, { "location_code": 2604, "location_name": "Peru", "country_iso_code": "PE", "location_type": "Country" }, { "location_code": 2724, "location_name": "Spain", "country_iso_code": "ES", "location_type": "Country" }, { "location_code": 2862, "location_name": "Venezuela", "country_iso_code": "VE", "location_type": "Country" } ] }, { "language_name": "Swedish", "language_code": "sv", "available_locations": [ { "location_code": 2752, "location_name": "Sweden", "country_iso_code": "SE", "location_type": "Country" } ] }, { "language_name": "Chinese (Simplified)", "language_code": "zh-CN", "available_locations": [ { "location_code": 2156, "location_name": "China", "country_iso_code": "CN", "location_type": "Country" }, { "location_code": 2344, "location_name": "Hong Kong", "country_iso_code": "HK", "location_type": "Region" }, { "location_code": 2158, "location_name": "Taiwan", "country_iso_code": "TW", "location_type": "Region" } ] }, { "language_name": "Chinese (Traditional)", "language_code": "zh-TW", "available_locations": [ { "location_code": 2156, "location_name": "China", "country_iso_code": "CN", "location_type": "Country" }, { "location_code": 2344, "location_name": "Hong Kong", "country_iso_code": "HK", "location_type": "Region" }, { "location_code": 2158, "location_name": "Taiwan", "country_iso_code": "TW", "location_type": "Region" } ] }, { "language_name": "Norwegian", "language_code": "no", "available_locations": [ { "location_code": 2578, "location_name": "Norway", "country_iso_code": "NO", "location_type": "Country" } ] } ] } ] }
By calling this API you will receive the list of locations and languages supported by Bing ‘Search Volume History’ endpoint.
As a response of the API server, you will receive JSON-encoded data containing a tasks
array with the information about available locations and languages.
Field name | Type | Description |
---|---|---|
version |
string | the current version of the API |
status_code |
integer | general status code you can find the full list of the response codes here |
status_message |
string | general informational message you can find the full list of general informational messages here |
time |
string | execution time, seconds |
cost |
float | total tasks cost, USD |
tasks_count |
integer | the number of tasks in the tasks array |
tasks_error |
integer | the number of tasks in the tasks array returned with an error |
tasks |
array | array of tasks |
id |
string | task identifier unique task identifier in our system in the UUID format |
status_code |
integer | status code of the task generated by DataForSEO; can be within the following range: 10000-60000 you can find the full list of response codes here |
status_message |
string | informational message of the task you can find the full list of general informational messages here |
time |
string | execution time, seconds |
cost |
float | cost of the task, USD |
result_count |
integer | number of elements in the result array |
path |
array | URL path |
data |
object | contains the parameters passed in the URL of the GET request |
result |
array | array of results |
language_name |
string | language name |
language_code |
string | language code according to ISO 639-1 |
available_locations |
array | array of available locations for a certain language |
location_code |
integer | location code |
location_name |
string | full name of the location |
country_iso_code |
string | ISO country code of the location |
location_type |
string | location type |