Search a city or region to measure
seo_rankings.locations.search
Searches the places of a country (a city, a province or state, a department, a municipality, a county) that a rank tracking project can measure instead of the whole country: q is 2 to 60 characters looked for in the place's label, that is, its name and the region it belongs to (accents and case do not matter), country_code one of the supported countries (400 rank_location_country_unsupported otherwise) and limit up to 20. Returns places, each with its code, its label without the country ("Rosario, Santa Fe Province") and its type; places whose own name is exactly the text come first, then names that start with it, cities first among equals. When several places match, ask which one; never pick the first blindly. Requires view access to Rankings. To measure a place, send its code as location_code of an engine in seo_rankings.projects.create or seo_rankings.projects.update (same engine and country): the place becomes its own combination ({engine}_{country}{code}_{device}), apart from the whole country, which can be measured side by side. Only google has places: with engine bing the list is empty and saving a place there is 400 rank_location_engine_unsupported. It reads a list kept by MB Suite: no cost and nothing is measured.
- Scope
seo_rankings:read- Permission
- View the module
- MCP tool
seo_rankings_locations_searchOn the full surface; on the compact one,mb_execute_operationwithid: "seo_rankings.locations.search".
Declared cost: up to 0 reads and 0 writes per call (they count against the daily quota).
Parameters
country_codestringqueryCountry to search in (ISO): one of the supported countries, else 400 rank_location_country_unsupported.
qstringqueryText to look for in the place's name, 2 to 60 characters; accents and case do not matter (cordoba finds Córdoba).
engineenumqueryoptionalSearch engine. Only google has places: bing measures by country and returns an empty list.
Values: google, bing · Default: "google"
limitintegerqueryoptionalHow many places to return (default and maximum 20).
Default: 20
Response
placesarray<object>Matching places: names that start with the text first, then the ones with a word that does, then the ones that contain it; cities first inside each group.
Errors
Example
curl "https://api.mb-suite.com/v1/seo/rankings/locations?country_code=COUNTRY_CODE&q=Q" \
-H "Authorization: Bearer $MB_API_KEY"Try it with your test API key
With a test API key the request always goes to your practice organization: example data you can reset.
curl "https://api.mb-suite.com/v1/seo/rankings/locations?country_code=COUNTRY_CODE&q=Q" \
-H "Authorization: Bearer $MB_TEST_KEY"