OxinionDevelopers
Location

Places

Enrich location data with named place context — venues, categories, and semantic meaning.

Overview

The Places module maps raw coordinates to meaningful venue data — name, categories, and chain info — and fires events when users enter or exit known places.

Search nearby places

typescript
1import { createOxinion } from 'oxinion';
2
3const oxinion = createOxinion({ apiKey: 'pk_...' });
4
5const { data, error } = await oxinion.places.search({
6 near: { latitude: 37.7749, longitude: -122.4194, radiusMeters: 200 },
7 categories: ['cafe', 'restaurant'],
8 limit: 10,
9});
10
11if (data) {
12 data.forEach((place) => {
13 console.log(place.name, place.categories); // categories is string[]
14 });
15}

Listen for place events

typescript
1oxinion.places.listen('enter', (event) => {
2 console.log('Entered:', event.place.name);
3 console.log('Categories:', event.place.categories); // string[]
4 console.log('User:', event.user.id, '| Confidence:', event.confidence);
5});
6
7oxinion.places.listen('exit', (event) => {
8 console.log('Left:', event.place.name);
9});

Methods

places.search(params)
Search places near a coordinate. Params: { near: { latitude, longitude, radiusMeters }, categories?, limit? }.
places.get(id)
Fetch a single place by ID.
places.listen('enter' | 'exit', handler)
Subscribe to place visit events. Event shape: { place, user, confidence, timestamp }.