Skip to main content
100%

Filter api example

✓ Published0🌍 Public
RRobinL
Last edited Feb 9, 2019
Created on Feb 9, 2019

This example demonstrates the process of requesting a filtered dataset from the UK Office for National Statistics (ONS) API and asynchronously retrieving the resulting CSV file. It uses Python with the `requests` library to POST a JSON payload specifying a dataset edition and a geography dimension filter, then polls the returned `filter_output` link until the data is ready. The code parses the JSON response with `json.loads` and reads the CSV into a pandas DataFrame using `pd.read_csv`, highlighting an API workflow for on-demand data extraction.

AI-generated description

Similar vizzes