> For the complete documentation index, see [llms.txt](https://docs.os.uk/more-than-maps/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.os.uk/more-than-maps/using-os-mapping-apis/using-os-apis-with-epc-api.md).

# Using OS APIs with EPC API

This tutorial, using the python notebook below, is to help with using various OS APIs in python to access Ordnance Survey data. To ensure that multiple OS APIs are used, the notebook has been created with a use case of obtaining Energy Performance Certificates for properties in a specified postcode and visualising these on a map with their building footprints.

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-b7afc900a1888118052ca4f4fef15193072b7a91%2Fepc_api_map.png?alt=media" alt="Example output from using the python notebook code" width="563"><figcaption><p>Example output from using the python notebook code</p></figcaption></figure>

{% file src="/files/BHGm8wWLEbRum7jAbE7f" %}

This will show you how to obtain address data with EPC ratings from the OS Places API and EPC Domestic Rates API, TOIDs for these addresses using the OS Linked Identifiers API, obtaining building footprints (building\_part) using the OS NGD Features API and finally visualising these building footprints which are colour coded based on their energy performance rating on an OS basemap using the OS Maps API.

## What will be needed to use this:

* A Premium OS Datahub account – OS API Key
* An EPC Domestic Rates API Key
* A specified postcode that you would like to view
* Python installed on your machine
* The following python libraries to be installed to your environment:
  * Json
  * GeoPandas
  * Pandas
  * Requests
  * Time
  * Warnings
  * OS
  * Folium
  * Matplotlib

## Disclaimers

Please note that OS API throttling may cause errors in this notebook. To avoid these errors, then specify a postal code with less 600 or less addresses (unless you have different access). For further information on OS API throttling please visit [here](https://osdatahub.os.uk/support/plans#apiThrottling).

This is for domestic rates only; therefore commercial property EPC ratings will not be returned


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.os.uk/more-than-maps/using-os-mapping-apis/using-os-apis-with-epc-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
