Superface

Points of Interest

navigation/nearby-poi@1.0.1
2 providers

Find nearby points of interest

Find points of interest near the given location.

Input
center
radius
categories
Result
Coordinates of this point
Name of the point of interest
Categories this point belongs to

1.Choose a provider

2.Use NearbyPoi with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
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();

Structure details

Input (object)

center
Center of the search
latitude
longitude
radius
Radius of the search
categories
Optional categories filter Points belonging to at least one of these categories are returned
RESTAURANT
CAFE
BAR
SCHOOL
TAXI
POST
POLICE
HEALTHCARE
BANK
ATM
PARKING

Example

{
  "center": {
    "latitude": 51.477,
    "longitude": 0
  },
  "radius": 100,
  "categories": [
    "CAFE"
  ]
}

Result (list of objects)

coordinates
Coordinates of this point
latitude
longitude
name
Name of the point of interest
categories
Categories this point belongs to
RESTAURANT
CAFE
BAR
SCHOOL
TAXI
POST
POLICE
HEALTHCARE
BANK
ATM
PARKING

Example

[
  {
    "categories": [
      "CAFE"
    ],
    "coordinates": {
      "latitude": 51.476838,
      "longitude": -0.0006877
    },
    "name": "2738840351"
  }
]

Implementation details

Provider
mock
Use case
NearbyPoi
Author
@superface
Source
Verified