> For the complete documentation index, see [llms.txt](https://docs.os.uk/os-apis/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/os-apis/accessing-os-apis/os-match-and-cleanse-api/getting-started-with-an-example-match-query-using-node.js.md).

# Getting started with an example match query using Node.js

{% hint style="warning" %}

### Product has reached its End of Life (withdrawal) date

The OS Match & Cleanse API reached its End of Life on **31 March 2026** and was withdrawn. As a result, the API has been removed from existing API projects and is no longer be accessible. Historic usage of this API can still be tracked in the API Transaction History tab of the [OS Data Hub](https://osdatahub.os.uk/).

Documentation on this site for the API will remain in place for a short time to support customers migrating to a new solution. Future requests made to the OS Match & Cleanse API will fail. For further information, please visit [End of Life Information](/os-apis/accessing-os-apis/os-match-and-cleanse-api/end-of-life-information.md).
{% endhint %}

## What you need

* OS Match & Cleanse API added to an API project in the OS Data Hub with an API Key; see [Getting started with an API project](/os-apis/core-concepts/getting-started-with-an-api-project.md) for more information
* A text editor like Visual Studio Code
* A working installation of [Node.js](https://nodejs.org/) and the popular [axios](https://github.com/axios/axios) module

### Running a Match Query

```javascript
// Match Query
const axios = require('axios');

const apiKey = 'INSERT_YOUR_API_KEY_HERE';

async function match() {
    axios.get('https://api.os.uk/search/match/v1/match?maxresults=1&query=Ordnance%20Survey,%20Adanac%20Drive,%20SO16&key=' + apiKey).then(function (response) {
        console.log(JSON.stringify(response.data, null, 2));
    });
}

match();
```


---

# 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 dynamically by asking a question.

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

```
GET https://docs.os.uk/os-apis/accessing-os-apis/os-match-and-cleanse-api/getting-started-with-an-example-match-query-using-node.js.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
