Getting started with example queries using Node.js

This page provides example queries that you can adapt and use with OS Places API. The examples use Node.js the popular axiosarrow-up-right module.

circle-info

Please read this page in conjunction with Technical specification.

What you need

Running a Find query

const axios = require('axios');

const apiKey = 'INSERT_YOUR_API_KEY_HERE';

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

Running a Postcode query

Running a UPRN query

Running a Nearest query

Running a Bounding Box query

Running a Radius query

Running a Polygon query

Last updated

Was this helpful?