Q: How Do I Calculate My API Call's Point Cost

This article is related to the PurpleAir API. If you are unfamiliar with it, check out our API Landing Page to get started.

There are two main ways to determine the number of points an API call might require: calculating it yourself or using the Data Download Tool.

Calculating Required Points

The point cost for an API call has both a base cost and a cost per row based on your chosen fields. You can find a couple of tables that break down point costs per request and per field in the PurpleAir Develop Portal. When logged in, click on your profile on the top right and select “Billing.” In the billing menu, click on the “Pricing” tab.

Use the example provided in API Pricing to calculate point cost totals. The basis is that you will need to add together the point cost of the call and the point cost of the chosen fields. Then, if you plan to repeat the call or query multiple sensors, multiply that sum by the number of planned calls or sensors.

Using the Data Download Tool

Alternatively, you can use the Data Download tool to estimate point costs for you (please note that the Data Download Tool only supports historical API calls at this time). All you have to do is input the information for your API request, and the tool should automatically provide a cost estimation. The estimation should look as follows:

All values except Sensor Read Keys must be filled in to receive a point estimate. This includes “Sensor Indexes,” which is the list of sensors you would like to obtain data from. If you don’t yet have any indexes, you can enter 1111 to obtain an estimate for a single sensor.

It is important to only query a sensor when you know that it has produced data. If you are unsure, please consult How to Tell When A Sensor Produced Data.