Compare places
compareCompare one indicator across 2 to 10 places for the same period, using one shared source and definition whenever possible. Use it for "how does X compare with Y and Z". Places can mix levels, for example a city, a larger city and its region. Example: {"indicator": "registered_unemployment_rate", "places": ["Mataró", "Barcelona", "Cataluña"]}. Returns {indicator, period, comparable, values: [{place, value, period?, status?}], source or sources, notes?}. When comparable is false the values come from different sources (and sometimes periods) and notes explain why; mention it in your answer. For unemployment in municipalities use registered_unemployment_rate: the survey unemployment_rate is not published below province level. transform applies the same rule to every place, for example {"indicator": "gdp", "places": ["Spain", "Germany", "France"], "transform": "per_capita"}. Population and price index series shared by every place are preferred; each value lists its inputs, and comparable is false when places needed different ones or a place could not be computed (notes say why). With as_of every value is the one Invokely held then, with version, known_since, revised_later and current; comparable reflects the sources available then.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | index: the period equal to 100, for example "2015" or "2020-01" (a year of a monthly series is the average of its months). real: the year whose prices values are expressed in, for example "2024". | |
| as_of | No | Optional point in time, UTC: a date ("2026-10-03", meaning the end of that day) or a date and time with a zone ("2026-10-03T14:30:00Z"). Returns the figures as Invokely held them at that instant, for backtests, audits and reproducible runs. Must not be in the future. | |
| period | No | Optional. "2024" (year), "2024-Q3" (quarter), "2024-S1" (half year) or "2024-09" (month). Omit for the latest value. | |
| places | Yes | Place names or ids. | |
| window | No | rolling_mean only: number of periods averaged, 2 to 12. Default 3. | |
| 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 calculation done by the server, with every input cited. pct_change: % change from the previous period. yoy: % change from the same period a year earlier (12 months, 4 quarters or 1 year back). diff, yoy_diff: the same changes as differences, in the indicator unit (percentage points for rates). index: value / value in base x 100 (needs base). rolling_mean: average of the last window periods. per_capita, per_1000, per_100k: a total (population, births, GDP, emissions) divided by the population of the same place and year. real: a money amount at current prices adjusted for inflation with the consumer price index of the place's country in the same currency (base: price year, default the latest complete year). share_of_parent: a total as % of the parent place (county of its state, state of the nation, region of its country). Per person and share transforms refuse rates, shares, indices, medians and per person values, and share_of_parent also refuses net balances such as net migration; pct_change, yoy and index refuse percentages. | |
| 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. |