Create a chart
create_chartTurn a question into a chart card, without thinking about chart types: the standings of the latest race, poll or election results by candidate, wins in a season, coverage over time, share of voice between names, tone, the outlets that cover a topic most, what an outlet published, a timeline of a story, the figures the articles publish (a price, a rate), or data from a custom index. It works out what the user expects (understood, with other readings to pass as interpretation), verifies every value against its source, picks the chart, the key figures and a title that states the finding, and returns an image URL (show it to the user) and an embed URL. If the exact data is not published it shows the closest thing and says so (rung, warnings). It costs its search (the mode it needs, per query) plus US$0.50 per 1,000 charts; the same request within 10 minutes is free.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Only the last N days, 1 to 365. By default it depends on the chart: 30 for coverage, 7 for figures. | |
| type | No | auto (default) picks the chart that tells the data best. Or force one: line, area, bar, bar_horizontal, stacked_bar, pie, donut, scatter, funnel, timeline, kpi, table. | auto |
| index | No | Optional: chart your own custom index (idx_…) instead of the news: prices, ratings, availability, brands. | |
| query | Yes | What to chart, in plain words and any language: "blue dollar this week", "Milei vs Bullrich coverage", "tone of the IMF coverage", "which outlets cover lithium", or "prices" with index. | |
| theme | No | light (default), dark, editorial (warm paper) or electric (deep blue). | light |
| compare | No | What to compare, 2 to 5, if the query does not say it with "vs": ["Milei", "Bullrich"]. | |
| countries | No | Only sources from these countries: ISO 3166-1 alpha-2 codes, such as ["AR"] or ["US", "GB"]. | |
| languages | No | Only sources that publish in these languages: ISO 639-1 codes, such as ["es"] or ["en", "pt"]. | |
| interpretation | No | Optional: one of the `alternatives` of a previous call, to chart that reading of the query instead. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| data | No | The values drawn (up to 40 per series). | |
| rung | No | exact (the data asked for), partial (a verified part), related, coverage or stories (the closest thing found). | |
| type | Yes | ||
| table | No | The rows of a table chart (up to 10), keyed by column label. | |
| title | Yes | It states the finding. | |
| cached | No | ||
| events | No | ||
| sources | No | ||
| cost_usd | Yes | ||
| subtitle | No | ||
| warnings | No | ||
| embed_url | No | An iframe for a web page or app. | |
| image_url | No | PNG: show it to the user. | |
| improving | No | Still looking for the exact data: the image and embed update themselves if it arrives. | |
| request_id | Yes | ||
| understood | No | What we understood the user expects to see. | |
| key_figures | No | ||
| alternatives | No | Other readings of the query: pass one as `interpretation` to chart it instead. |