We're currently using the Node.js library on our API. We have recently been getting a lot of errors from the Prismic API. This is the error we're seeing:
Error: Unexpected status code [429] on URL https://xxx.prismic.io/api/v2?access_token=xxxx
at /var/task/node_modules/prismic-javascript/dist/prismic-javascript.min.js:1:16437
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
status: 429
}
I tried to dig up more info and couldn't really find much except a note here saying that Prismic doesn't limit API requests.
So in reality are there API limits or throttles in place? Would just be good to know so we can build accordingly.
Thanks for posting! At first glance, I’m not sure what this error might be caused by. Could you send me a DM with the name of your repo? And also the code snippet that is causing the problem? Then I’ll send a message to our development team to see if they can help.
I’ve submitted an issue to our development team, and I’ll let you know what I hear back. Let me know if there’s anything else I can help with in the meantime.
Sometimes this error can happen if you’re not using the CDN. If you change your api endpoint to https://xxx.cdn.prismic.io/api/v2?access_token=xxxx, does that help with the error?
Sunil, are you using the REST API? And, if so, are you using the CDN like I mentioned above to Matt?
Sean, I don’t think GraphQL has the same issue with the CDN, so I’ll need to do some more investigating. Can you send me the code that is generating the error, either on this thread or in a DM?
@samlittlefair just wanted to follow up on this, we haven't seen any more errors since making these changes a week or so ago, so I think it's fair to say that fixed the issue. Thanks heaps!
Might be worth updating the docs though. I was following this guide which has the apiEndpoint set as https://your-repository-name.prismic.io/api/v2 so adding the cdn in there would help alleviate these issue for further devs.
Sorry for the delay in responding. You're getting the error using the Rest API, with https://xxx.cdn.prismic.io/api/v2/documents/search?
Could you share your repo name, the technology you're using, and the code for the page that is throwing the error? You can send it in a DM if you don't want to share it publicly.
Thanks,
Sam
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
20
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.