Rank places
rank_placesRank every place of one level inside an area by an indicator: all countries of the world, EU countries, US states, the counties or cities of a state, US cities, the regions of a country, the municipalities of a Spanish province. Use it for "which state has the highest unemployment", "top 10 countries by GDP per capita", "poorest counties in Texas", "EU countries with the lowest inflation". level is the level of the ranked places (country, region, province, municipality); within is the area they belong to. US states are regions of "United States"; US counties are provinces of a state; US cities are municipalities of "United States" or of a state; EU NUTS 2 regions are regions of "EU" or of a country. Example: {"indicator": "unemployment_rate", "level": "region", "within": "United States", "limit": 5}. Countries of the world: {"indicator": "population", "level": "country"}. Returns {indicator, level, within, period, comparable, order, total, values: [{rank, place, value, status?}], source, notes?}. Every value comes from one source and one period. order "asc" lists the lowest first. Cite source.citation. For rates across municipalities pass min_population (for example 5000) so very small places, where a few people move the rate, do not top the list. transform ranks a calculated figure: per_capita, per_1000 or per_100k for totals (population from one series for every place), yoy or yoy_diff for change from a year earlier. Example: {"indicator": "gdp_usd", "level": "region", "within": "United States", "transform": "per_capita"}. Each value lists its inputs; places without an input are left out and counted in notes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | Yes | Level of the places ranked. | |
| limit | No | Optional. Rows to return, 10 by default. | |
| order | No | Optional. desc (highest first, default) or asc. | |
| period | No | Optional. "2024" (year), "2024-Q3" (quarter), "2024-S1" (half year) or "2024-09" (month). Omit for the latest value. | |
| within | No | Optional area that contains the ranked places, for example "United States", "EU", "Germany", "Texas", "Cataluña". Omit to rank all countries. | |
| country | No | Optional ISO 3166-1 alpha-2 code to disambiguate the place, for example "ES" or "US". | |
| indicator | Yes | Indicator id from search_indicators, for example "population", "registered_unemployment_rate", "unemployment_rate", "cpi_annual_change", "net_income_per_person". | |
| transform | No | Optional. per_capita, per_1000, per_100k (totals only) or yoy, yoy_diff. See get_value. | |
| citation_style | No | Optional. Adds source.citations with the citation in this style (APA 7, MLA 9, Chicago author-date, Harvard, BibTeX or RIS), or in all six with "all". The publisher is the author. Leave it out to keep the response short. | |
| min_population | No | Optional. Leave out places with fewer residents. |