POST /api/ourworldindata/charts
Price: 10 credits
Our World in Data chart by slug or URL: title, subtitle, notes, chart types, default countries, the view dimensions of a multi-view chart, and every indicator it plots with unit, descriptions, time coverage, update dates and sources with citations and licences.
Describes one chart and its indicators; the values themselves come from ourworldindata/charts/data. A multi-view chart such as energy-mix returns its dimensions and the view picked by the URL or by dimensions. Find slugs with ourworldindata/charts/search.
access-token string requiredtimeout integer — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)chart string required — Chart slug or URL (examples: "life-expectancy", "https://ourworldindata.org/grapher/gdp-per-capita-worldbank", "https://ourworldindata.org/grapher/energy-mix?metric=per_capita&source=total"; minLength: 1)dimensions object nullable — View choice per dimension of a multi-view chart (examples: {"metric":"per_capita","source":"total"})* string@type string (default: "OurWorldInDataChart")url string requiredalias string requiredid string nullableconfig_id string nullablechart_kind string nullablesubtitle string nullablenote string nullablevariant_name string nullablechart_types array (default: [])default_tab string nullablehas_map_tab boolean nullabledefault_entities array (default: [])article_url string nullabletopic_tags array (default: [])dimensions array (default: [])@type string (default: "OurWorldInDataDimension")alias string requiredname string nullablewidget string nullablechoices array (default: [])@type string (default: "OurWorldInDataChoice")alias string requiredname string nullabledescription string nullablegroup string nullablechoices array (default: [])@type string (default: "OurWorldInDataSelectedChoice")dimension string requiredchoice string requiredindicators array (default: [])@type string (default: "OurWorldInDataIndicator")id string requiredchart_roles array (default: [])name string nullabletitle_variant string nullabledisplay_name string nullableunit string nullableshort_unit string nullablevalue_type string nullablecategories array (default: [])description_short string nullabledescription_key array (default: [])description_processing string nullabledescription_from_producer string nullabledescription string nullabletimespan string nullabletime_interval string nullablezero_day string nullableentity_count integer nullabletime_count integer nullabledataset_id string nullabledataset_name string nullabledataset_version string nullablecatalog_path string nullableshort_name string nullableprocessing_level string nullableupdate_period_days integer nullableis_redistributable boolean nullableattribution string nullableattribution_short string nullabletopic_tags array (default: [])created_at integer nullableupdated_at integer nullablesources array (default: [])@type string (default: "OurWorldInDataSource")id string nullabletitle_snapshot string nullableproducer string nullabledescription string nullabledescription_snapshot string nullablecitation string nullableattribution string nullableattribution_short string nullableversion string nullableurl string nullabledownload_url string nullablepublished_date string nullableaccessed_date string nullablelicense_name string nullablelicense_url string nullable422 — Unknown view dimension or choice Check the fields against this schema. A URN with the wrong prefix is the most common cause.408 — The request ran past its time limit Raise `timeout` in the request body, up to the maximum this endpoint documents. Lowering `count` or turning off the `with_*` flags also helps, because less work finishes sooner.412 — Chart not found Retrying will not help: either the entity does not exist, or the input points at a different one.429 — Too many requests: a rate limit or a usage window is exhausted When the response carries an X-Retry-After header, wait that many seconds and retry: the same number is in the body as `detail.retry_after`, and the limit clears once that window passes. The message in the body names the limit that was hit.500 — Something broke on our side Retrying will not help. If it keeps happening, send us the X-Request-ID from the response headers.529 — Rate limit reached, or the endpoint is overloaded Wait at least 30 seconds, then retry.X-Error — Error message text (present only on error)X-Request-ID — Unique request identifierX-Execution-Time — Execution time in secondsX-Result-Count — How many records the body carries. 0 means an empty result, which is a normal answer and not by itself an error. A non-zero count can come back together with X-Error when the failure happened partway through — read this header and X-Error independently.X-Total-Available-Results — How many records exist for this query, when the endpoint can say. On a `dry_run` request this is the answer and the body is empty. It saturates: the endpoint's documented maximum means 'at least that many', any smaller number is exact.X-Warning — Present when the request body carried keys this endpoint does not document. They were ignored, so any filter you meant to apply through them did not apply. Check the spelling against this schema and retry.X-Retry-After — Seconds to wait before retrying. Present only on 429.