Points of Interest

navigation/nearby-poi@1.0.1
Supported by 2 providers
GM
OD

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

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

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
radius
Radius of the search
categories
Optional categories filter Points belonging to at least one of these categories are returned

Example

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

Result (list of objects)

coordinates
Coordinates of this point
name
Name of the point of interest
categories
Categories this point belongs to

Example

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

Implementation details

Provider
mock
Use case
NearbyPoi
Author
@superface
Source
Verified