Find points of interest near the given location.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');
// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });
async function run() {
// Load the profile
const profile = await sdk.getProfile('navigation/nearby-poi@1.0.1');
// Use the profile
const result = await profile
.getUseCase('NearbyPoi')
.perform({
center: {
latitude: 51.477,
longitude: 0
},
radius: 100,
categories: [
'CAFE'
]
}, {
provider: 'mock'
});
// Handle the result
try {
const data = result.unwrap();
console.log(data);
} catch (error) {
console.error(error);
}
}
run();
{
"center": {
"latitude": 51.477,
"longitude": 0
},
"radius": 100,
"categories": [
"CAFE"
]
}
[
{
"categories": [
"CAFE"
],
"coordinates": {
"latitude": 51.476838,
"longitude": -0.0006877
},
"name": "2738840351"
}
]