Skip to content

Instantly share code, notes, and snippets.

@TravelTime-Frontend
Last active February 21, 2023 08:50
Show Gist options
  • Save TravelTime-Frontend/22221ea47d8998d67b427307f1537f81 to your computer and use it in GitHub Desktop.
Save TravelTime-Frontend/22221ea47d8998d67b427307f1537f81 to your computer and use it in GitHub Desktop.
Time Map API Request, JavaScript
import {
TravelTimeClient,
} from 'traveltime-api';
const travelTimeClient = new TravelTimeClient({
apiKey: 'YOUR_APP_ID',
applicationId: 'YOUR_APP_KEY',
});
const departure_search = {
id: '60 minute drive area from Times Square',
coords: { lat: 40.758896, lng: -73.98513 },
departure_time: '2022-11-17T15:00:00-05:00',
travel_time: 1800,
transportation: { type: 'driving' },
};
travelTimeClient.timeMap({
departure_searches: [departure_search],
}).then((data) => console.log(data))
.catch((e) => console.error(e));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment