# 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="/files/bVcPT9MjziDQaJ3dlZE4" 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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
