Get one value
Get one official figure for an indicator and place: the latest by default, or a given period. Use it for questions like "population of Mataró", "inflation in Spain in 2024-09", "unemployment rate in Cataluña", "unemployment rate in Texas". Example: {"indicator": "population", "place": "Mataró"}. Returns {indicator: {id, name, unit}, place: {id, name, level}, period, value, status?, source: {name, title, url, retrieved, published?, citation, inputs?}, note?}. note is a caveat about the source series served. Pass citation_style ("apa", "mla", "chicago", "harvard", "bibtex", "ris" or "all") when the user wants a formatted reference: the source block then carries citations {style: text}. Always cite source.citation or source.url when you answer. When source.via is present (Data Commons), the publisher is still the original agency; the citation already names both. status "provisional" or "estimated" means the figure may be revised; say so. status "low_reliability" means the publisher flags the figure as of low reliability (usually a small survey sample); say so and treat it as a rough indication. If the indicator is not published for that place you get an error that names the levels where it exists and related indicators that do have data. Calculated figures: pass transform instead of doing the arithmetic yourself. Examples: {"indicator": "gdp", "place": "Spain", "transform": "per_capita"}, {"indicator": "median_household_income", "place": "Texas", "period": "2019", "transform": "real", "base": "2024"}, {"indicator": "registered_unemployment", "place": "Mataró", "transform": "yoy"}. The result adds transform {id, name, description, unit, from_unit, base?, notes?} and inputs [{role, indicator, place, period, value, unit, source}]; indicator.unit is the unit of the result. Cite the inputs' sources as well. A value that cannot be computed (no earlier period, no population for that year) is a NO_DATA error with the reason, never an estimate. Without period, when the latest period cannot be computed yet (this year's population not published), the latest period that can, at most two years earlier, is returned and transform.notes says so: quote the period returned. status is set when the value or any input is provisional or estimated. Point in time: pass as_of for "what was reported for September as of October 3". The answer adds as_of, version, known_since (when Invokely first held that version), revised_later and, when the figure changed since, current {value, status?, version, known_since}; say that it was revised. Source choice follows the same rules applied to the data held then. Before Invokely first stored the figure you get NO_DATA with vintage_coverage_starts, never today's value. With a transform, every input (earlier value, population, parent place, price index) is read as held at as_of, and each input carries version and known_since.
Request
- Base URL: https://invokely.ai
- URL: https://invokely.ai/api/v1/value
- Auth: one of:
- HTTP bearer
- API key in header x-api-key
- none
Query parameters
Indicator id, for example population or registered_unemployment_rate. List them with /api/v1/catalog.
Place name or id, for example Mataró, Texas, Japan, "Austin, TX", es-mun-08121, ES51 (NUTS), fips:48453 (US county) or fips:4805000 (US city).
2024 (year), 2024-Q3 (quarter), 2024-S1 (half year) or 2024-09 (month). Omit for the latest value.
Force a frequency when the indicator exists in several.
ISO 3166-1 alpha-2 code that disambiguates the place, for example ES or US.
Language of names and definitions. Default en.
Calculation done by the server, with every input cited: pct_change, yoy, diff, yoy_diff, index (needs base), rolling_mean (window), per_capita, per_1000, per_100k, real (inflation adjusted, base is the price year) or share_of_parent. See the get_value tool description and /docs#transforms.
index: the period equal to 100, for example 2015 or 2020-01. real: the year whose prices values are in, for example 2024.
rolling_mean: number of periods averaged.
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. Omit to keep the response short.
Point in time, UTC: a date (the end of that day) or a date and time with a zone. Returns the figures as Invokely held them then, with version, known_since, revised_later and the current value when it changed since. Not in the future.
Response
Success. The body is {"data": ...}; the remaining allowance is in the x-invokely-remaining header.
Changes
No recorded changes to this operation across all 1 revision of this API.