PaymentRequiredError making api calls

When trying to make a request to the historical data endpoint

https://api.purpleair.com/v1/sensors/124139/history/csv?api_key=xxx-xxx-xxx&start_timestamp=1679543743&fields=humidity,temperature,pressure,pm2.5_alt

but am getting

 "api_version" : "V1.0.11-0.0.42",
  "time_stamp" : 1679520736,
  "error" : "PaymentRequiredError",
  "description" : "Payment is required to make this api call."

I tried doing a top up on the developer portal but otherwise can’t find any documentation about this error! help would be appreciated

1 Like

Hi @Sam_Wolfand, your organization starts with one million points. However, these points are not added to any projects yet. On develop.purpleair.com, select the “Projects” tab. Next to the project you want to add points to, select the “Update Project” button. Near the top of this pop-up is your organization’s total number of points. Below that, you can enter the number of points to give to this project. Once that is updated, your API keys will work once more.

1 Like

Thanks Ethan and Sam. I am having the same problem. I tried finding this develop.purpleair.com page, but keep getting junk bots. (it redirects me to realgadssolutions.com) Can you please provide a full link? I also am not sure what “my organization” is. I want to download some sensor data for a class project.

Hi @Ethan, I am having the same problem as @Sam_Wolfand. I followed your instructions to add points to my project and update it, however, when I make an API call I still receive the same error.

The full link is https://develop.purpleair.com/.

Hi @Billy_Schmae, can you share in an email or personal message the request you are making as well as your API keys? I believe I have pulled up your project and can see that the points have been added correctly.

Thanks for responding @Ethan, just tried my API call again one more time and it worked. Not sure why it wasn’t working earlier.

1 Like

I’ve also got this issue, having transferred my credits (something which should probably be documented in the other guides!) I am still getting the Payment error.

I hope perhaps there is just a delay in noticing that the credits have been applied?

However, it is “costing” me credits every time I make an API call to see if it’s worked yet: I can see the credit count decreasing every time I make a (failed) call - so what’s going on here?

Furthermore, I only want data from my own sensor. Will I be expected to pay for more credits for this at a future point?

Screenshot from 2023-03-28 12-03-34

I am being docked credits for making API calls which fail because I don’t have enough credits?

1 Like

Six or so hours after moving the credits, the API call is now working.

I understand why there might be a delay - but it’s still an issue that I ‘spent’ credits on calls which failed?

In addition, I’d like some clarity on whether I’ll have to pay to get data from my own sensor in the future. This seems deeply opposed to the values and goals of citizen science as I understood PA to promote… (I’d understand paying for collective data - to some extent - but when I’m contributing data for free, I expect some in return).

The link was misspelled previously, which is why it was redirecting incorrectly. I’ve fixed the link, so it will redirect you to the right place now.

We are investigating this issue further to correct any errors that may exist. We are able to replicate this on our end. We will inform everyone of our findings.

More documentation on the develop site can be found in this article: New API Online Dashboard.

Thank you – am also having the same issue.

I’ve read through this page and made sure the steps were followed. I’ve attached the given account points to the project but I am still seeing “PaymentRequiredError”

The worst part about this is these also count and are actually chipping away at the points in my project just to return an error :frowning:

2 Likes

Yea, I’m down 10 credits trying to get data from my new sensor, even though they all respond with ‘you have to pay’ lol.

But, I did do the math… We get 1 million ‘credits’ so if I only wanted to get updates from a single sensor that would be 1 minute updates for like 2 years. For me I get my 5-10 minute updates from a Davis Instruments sensor cluster, so I’ll probably only poll my Purple once every 30-60 minutes which would be like 70-100 years of polling?

So false ‘charges’ during app development don’t really add up much…And at their most expensive rate you get another million for $10

We’ve been able to replicate this issue. It is a delay (around 60 minutes) in the system updating the points balance under the Project. Thus, even though you may see the points added to the Project, they may not yet be visible on the back end.

We’re looking into the source of the delay and hope to have this issue resolved soon. In the meantime, we recommend you wait 60 minutes or so after first adding points to your Project. If you are concerned about the points lost with the error message during this delay period, please send us an email at contact@purpleair.com and provide your API read key.

Be aware, however, that moving forward, API calls will cost points for the designated API endpoint, even when receiving an error message. This is typical of API points systems.

It definitely isn’t a 60 minute delay.

I disabled an automated call on Monday after it still wasn’t working for 3 days. Only the first batch of calls were made before I moved points from the main thing in to the specific project thing.

I’ll reenable it when I get home today to see if it works yet.

Can you email us at contact@purpleair.com with your API read key? We’d like to take a look at this.

This issue has been resolved. A change of point balance should be almost instantly applied. If the delay issue still occurs for anyone, please let us know.

2 Likes

I just found this post, transferred my (remaining) points to my project, and it’s still failing. All the while losing points for trying to get this figured out. The fact that there are indeed points associated to the project, but your API is failing to recognize that should not be considered a 4xx bad request, and should definitely not cost points (which according to the API I don’t have)

Hi Jason, please send an email to contact@purpleair.com with your API read key. We’d like to take a look at this for you.