Net Zero Data API developer guide

Overview

The Net Zero Data API provides access to the entire suite of Net Zero Data datasets. Designed for developers and analysts, the API enables seamless integration of Net Zero Data into your tools, models, and reports.

Authentication is handled via an x-api-key header. You’ll be able to generate your API key upon registration.

Include your API key in a header:

x-api-key: YOUR_API_KEY

URL: https://api.netzeromarket.org.uk/api/queries

Method: POST

Headers:

x-api-key
Content-Type: application/json
FieldTypeDescriptionRequired
tablestringName of the dataset to query (case-sensitive)
filterstringSQL-like filter. You can filter on any column in the selected dataset.
Must include localAuthority='YourRegion' condition.
You can also include additional filters on any other column.
limitintegerMax number of rows to return
columnsstringColumns to return (defaults to * if none specified)
orderbystringColumn to order results by (e.g. ashp_flag ASC)

NOTE: All queries must include a localAuthority='YourRegion' condition in the filter field. This ensures results are scoped to a specific region.

You can combine it with other conditions (e.g. propertyType='Commercial' AND localAuthority='Leeds').

These are the valid values you can use for the table parameter in your request body:

Dataset NameDescription
inferredepcsEPC Actual & Inferred – Domestic
demandBuildings & Modelled Energy Demand – Domestic
ndb_demandBuildings & Modelled Energy Demand – Non-Domestic
lswLarge Scale Wind Potential
gmsSolar PV Ground Mount
rooftopsolarPotential for Rooftop Solar PV (domestic & non-domestic)
ashpAir Source Heat Pump Potential (domestic & non-domestic)
gshpGround Source Heat Pump Potential (domestic & non-domestic)
ospOff Street Parking Potential
publicchargepointsExisting Public Chargepoint locations
evhubsEV Charging Hubs Potential
mergeddnoMerged DNO Data
solarcarportsPotential Locations for Solar Carports
oscPotential Locations for On-Street Charging
Python – Export to GeoJSON

This helper function allows you to submit queries to the API, download the results, convert WKB geometry columns into GeoDataFrames for spatial analysis, and export the data to spatial file formats such as GeoJSON.

import requests
from io import StringIO
import geopandas as gpd
import pandas as pd
from shapely import wkb
api_key='your api key'
def return_gdf(api_key,dataset,local_authority,limit,filter=None,columns=None,orderBy=None):
url="https://api.netzeromarket.org.uk/api/queries"
headers = {
'x-api-key': api_key,
'Content-Type': 'application/json'
}
if filter==None:
sql_query=f"localAuthority='{local_authority}'"
else:
sql_query=f"localAuthority='{local_authority}' and {filter}"
body = {
"table": dataset,
"filter": sql_query,
"limit": limit,
"columns":columns,
"orderBy":orderBy
}
response = requests.post(url, headers=headers, json=body)
presigned_url=response.json().get('downloadUrl')
download_response = requests.get(presigned_url)
df=pd.read_csv(StringIO(download_response.text))
df['geometry']=df['geometry'].apply(wkb.loads)
df=gpd.GeoDataFrame(df,geometry='geometry',crs=27700)
return df
gdf=return_gdf(api_key,'gshp','Adur',10)
##to output to file if required (geojson/gpkg/shapefile etc.)
gdf.to_file('your_file_path.geojson')
Python – Export to CSV

This sample code demonstrates how to query the Net Zero Data API, download the CSV results, and export the data to a local CSV file for further analysis. This example does not perform any geospatial processing and is suitable for users who require the raw tabular data.

import requests
import pandas as pd
from io import StringIO
api_key = 'your_api_key_here'
url = "https://api.netzeromarket.org.uk/api/queries"
def query_api(api_key, dataset, local_authority, limit=100, filter=None):
headers = {
'x-api-key': api_key,
'Content-Type': 'application/json'
}
base_filter = f"localAuthority='{local_authority}'"
sql_filter = f"{base_filter} AND {filter}" if filter else base_filter
payload = {
"table": dataset,
"filter": sql_filter,
"limit": limit
}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
result = response.json()
download_url = result.get('downloadUrl')
if not download_url:
raise ValueError("No downloadUrl returned")
csv_response = requests.get(download_url)
csv_response.raise_for_status()
df = pd.read_csv(StringIO(csv_response.text))
return df
# Example usage
df = query_api(api_key, dataset='gshp', local_authority='Adur', limit=20)
# Export CSV
df.to_csv("output.csv", index=False)
print("CSV exported to output.csv")

Data is returned as CSV. The schema depends on the dataset used or whether specific columns have been requested in the response.

HTTP CodeMessageLikely Cause
400Bad requestIncorrect column name or syntax
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient credits for the request
429Rate limit exceededToo many requests – slow down
500Internal server errorUnexpected issue – contact us

For full details, see our Terms of sale.

Need help?

If you have any questions or need technical assistance integrating with the Net Zero Data API, contact us.