

Net Zero Data API developer guide
Seamless, scalable, programmatic access
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
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
Endpoint
URL: https://api.netzeromarket.org.uk/api/queries
Method: POST
Headers:
x-api-key
Content-Type: application/json
Request body
| Field | Type | Description | Required |
|---|---|---|---|
table | string | Name of the dataset to query (case-sensitive) | ✅ |
filter | string | SQL-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. | ✅ |
limit | integer | Max number of rows to return | ✅ |
columns | string | Columns to return (defaults to * if none specified) | ❌ |
orderby | string | Column 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').
Available datasets
These are the valid values you can use for the table parameter in your request body:
| Dataset Name | Description |
|---|---|
inferredepcs | EPC Actual & Inferred – Domestic |
demand | Buildings & Modelled Energy Demand – Domestic |
ndb_demand | Buildings & Modelled Energy Demand – Non-Domestic |
lsw | Large Scale Wind Potential |
gms | Solar PV Ground Mount |
rooftopsolar | Potential for Rooftop Solar PV (domestic & non-domestic) |
ashp | Air Source Heat Pump Potential (domestic & non-domestic) |
gshp | Ground Source Heat Pump Potential (domestic & non-domestic) |
osp | Off Street Parking Potential |
publicchargepoints | Existing Public Chargepoint locations |
evhubs | EV Charging Hubs Potential |
mergeddno | Merged DNO Data |
solarcarports | Potential Locations for Solar Carports |
osc | Potential Locations for On-Street Charging |
Example code
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 requestsfrom io import StringIOimport geopandas as gpdimport pandas as pdfrom shapely import wkbapi_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 dfgdf=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 requestsimport pandas as pdfrom io import StringIOapi_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 usagedf = query_api(api_key, dataset='gshp', local_authority='Adur', limit=20)# Export CSVdf.to_csv("output.csv", index=False)print("CSV exported to output.csv")
Response format
Data is returned as CSV. The schema depends on the dataset used or whether specific columns have been requested in the response.
Common errors
| HTTP Code | Message | Likely Cause |
|---|---|---|
| 400 | Bad request | Incorrect column name or syntax |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient credits for the request |
| 429 | Rate limit exceeded | Too many requests – slow down |
| 500 | Internal server error | Unexpected issue – contact us |
API credits & usage
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.
