I have never worked with an API before. How do I get started?
This guide walks you through setting up a Python notebook environment and running your first API call with the client.do() function.
The Altitude API provides programmatic access to geospatial datasets. With the Geotab Altitude Python package and a Python notebook environment, you can retrieve the data you need and use it in your own tools and workflows.
This guide is for users who are new to making API calls. In this section, you will learn how to:
- Install the Altitude Python package and authenticate your credentials in a Python notebook environment.
- Define your query parameters and run an API call using the
client.do()function. - Export the results as a CSV file.
This guide uses the getRoadSegments query as a working example to return all road segments in Clark County, Nevada.
If you run into any issues during this process, contact Altitude Support for assistance.
What is an API?
An Application Programming Interface, or API, allows different systems to exchange data without needing to know how the other system works.
For example, a flight-price app does not operate its own fleet of planes, it sends requests to the APIs of United, Delta, and American Airlines, receives their price data, and displays it in their flight-price app.
The Altitude API accepts requests that describe the data you want and returns a structured dataset you can work with directly.
Understanding the client.do() function
When you authenticate with Altitude during your initial setup, the Geotab Altitude Python package creates an object called client. This object represents your active connection to the API.
Calling client.do() tells your connection to send a query to Altitude and return the results. You define the parameters for the data that you need, while client.do() It handles session management, authentication, querying, and the data extraction call.