Location and language lookup endpoints; readable 422s; ISO country codes accepted
Two new reference-data endpoints let you look up the location and
language values that POST /v1/domains/{domain_uuid}/keywords accepts,
keyword create now takes an ISO country code for country-wide tracking, and
its 422 responses name the failing field and how to fix it.
New: GET /v1/locations and GET /v1/languages
GET /v1/locationslists the location catalogue for one search engine (search_engine=google|bing|yahoo, defaultgoogle). Filter bycountry(ISO 3166-1 alpha-2),variant(Country,City,Postal Code, …),code(an exact geo-target id) orq(a prefix of theCity,Region,Countryname, 2–100 characters). With none ofcountry,codeorqit lists the countries. Each row'scodeis the value to send assearch_engines[].location.GET /v1/languageslists the language codes for one engine;qmatches the exact code or a substring of the name. TheGloballanguage0000is never listed because keyword create rejects it.- Both are paginated with
page/per_page(default 100, max 1000) and theX-Total-Count,X-Total-Pages,X-Per-PageandX-Current-Pageheaders, require an API key with API access like every other/v1endpoint, and are not account-scoped.
See Reference values for the full parameter tables and worked examples.
Changed: keyword create
search_engines[].locationaccepts an ISO 3166-1 alpha-2 country code ("FR") as well as the geo-target id ("2250"). The ISO form resolves to the engine's country row, so both create the same keyword and it reads back withlocation.code2250.name,deviceandlanguageare matched case-insensitively and trimmed (Google,Desktop,FRare accepted and normalised togoogle,desktop,fr).frequencywas already case-insensitive.422responses are structured. An unknownfrequency,name,device,locationorlanguagereturnscodeinvalid_reference_valuewith asource.pointerto the exact field and ametablock (field,value,search_engine,allowed,lookup,docs). Every failure comes back in one response, except that an entry whosenameis unknown has itslocationandlanguagechecked only once the engine is fixed. A body with the wrong shape (missingfrequency,wordsthat is not an array of strings or is empty,search_enginesnot an array of objects) returnscodevalidation_failedwith the samesource.pointer/meta.fieldenvelope. Previously thedetailwas the raw database lookup message (Couldn't find Location …). See Errors & rate limits.404bodies are uniform across/v1:codenot_foundwith adetailsuch asDomain not found, instead of the raw lookup message.
The API Reference has been regenerated from the API's own request specs and now includes both lookup endpoints under Reference data.