Skip to main content

Download a data set as CSV

The CSV response will render its metadata in a human-readable format (instead of machine-readable IDs). The CSV is not subject to the same backward compatibility guarantees as the data set’s JSON representation in other endpoints.

The URL for this endpoint is:

GET https://api.education.gov.uk/statistics/v1/data-sets/{dataSetId}/csv

Parameters

Path parameters

The following parameters will need to be substituted into the URL path.

Parameter Type Required Description
dataSetId string true

The ID of the data set.

Query parameters

Parameter Type Required Description
dataSetVersion string false

The data set version e.g. 1.0, 1.1, 2.0, etc. Wildcard versions are supported. For example, 2.* returns the latest minor version in the v2 series.

Example request

To illustrate how to use this API endpoint, we have provided some samples below in various languages.

cURL

curl -X GET https://api.education.gov.uk/statistics/v1/data-sets/{dataSetId}/csv

JavaScript

const url = 'https://api.education.gov.uk/statistics/v1/data-sets/{dataSetId}/csv';

const response = await fetch(url, {
  method: 'GET',
});

console.log(response.json());

Python

import requests

url = 'https://api.education.gov.uk/statistics/v1/data-sets/{dataSetId}/csv'

response = requests.get(url)

print(response.text)

R

library(httr)

url <- "https://api.education.gov.uk/statistics/v1/data-sets/{dataSetId}/csv"

response <- GET(url)

output <- content(response)

Responses

Status Description Media Type Schema
200

The data set CSV file.

text/csv string
403

Forbidden

application/json ProblemDetailsViewModel
404

Not Found

application/json ProblemDetailsViewModel

Example successful response

This page was last reviewed on 15 November 2024.