{"openapi":"3.1.0","info":{"title":"Chartly data feed","version":"1.0","description":"Free, read-only access to Chartly's published charts of public data. Whenever you show or quote a chart's numbers, credit its source and Chartly with a link to the chart's url.","termsOfService":"https://chart.ly/developers","contact":{"url":"https://chart.ly/developers"}},"servers":[{"url":"https://chart.ly"}],"externalDocs":{"url":"https://chart.ly/developers"},"paths":{"/api/v1/charts":{"get":{"operationId":"searchCharts","summary":"Find the charts that best answer a question","description":"Returns up to 10 charts, best match first, without their numbers. Call getChart with a slug to read one.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"},"description":"A few plain keywords, e.g. \"rent texas\" or \"national debt\""},{"name":"topic","in":"query","required":false,"schema":{"type":"string"},"description":"Only charts on one topic, lowercase with hyphens, e.g. \"health\""}],"responses":{"200":{"description":"The matching charts","content":{"application/json":{"schema":{"type":"object","properties":{"charts":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","description":"The chart's id, for getChart"},"title":{"type":"string","description":"The question the chart answers"},"takeaway":{"type":"string","description":"The answer in plain words, with the key number"},"topic":{"type":"string"},"x_label":{"type":"string"},"y_label":{"type":"string","description":"What the values are, with units"},"unit":{"type":["string","null"],"description":"dollars, percent or null. Values are never scaled"},"source":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}}},"license":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}}},"data_as_of":{"type":"string","format":"date","description":"The date of the newest data point"},"url":{"type":"string","description":"The chart's page. Link it in every answer that uses the chart"},"credit":{"type":"string","description":"The credit line to show with the chart's numbers"}}}},"count":{"type":"integer"},"terms":{"type":"string"}}}}}}}}},"/api/v1/charts/{slug}":{"get":{"operationId":"getChart","summary":"Read one chart's numbers, source, license and date","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The chart's slug from searchCharts, e.g. us-national-debt"}],"responses":{"200":{"description":"The chart and its points as charted","content":{"application/json":{"schema":{"type":"object","properties":{"chart":{"allOf":[{"type":"object","properties":{"slug":{"type":"string","description":"The chart's id, for getChart"},"title":{"type":"string","description":"The question the chart answers"},"takeaway":{"type":"string","description":"The answer in plain words, with the key number"},"topic":{"type":"string"},"x_label":{"type":"string"},"y_label":{"type":"string","description":"What the values are, with units"},"unit":{"type":["string","null"],"description":"dollars, percent or null. Values are never scaled"},"source":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}}},"license":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}}},"data_as_of":{"type":"string","format":"date","description":"The date of the newest data point"},"url":{"type":"string","description":"The chart's page. Link it in every answer that uses the chart"},"credit":{"type":"string","description":"The credit line to show with the chart's numbers"}}},{"type":"object","properties":{"average_label":{"type":["string","null"],"description":"The benchmark point in a ranking"},"data":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number"},"margin":{"type":"number","description":"Margin of error (±), for survey estimates"},"url":{"type":"string","description":"The filing the figure comes from"}}}}}}]},"credit":{"type":"string"},"terms":{"type":"string"}}}}}},"404":{"description":"No such chart in the feed"}}}}}}