R
Railwayβ€’2y ago
malindu.dev

API limitations

Does Railway have an API call limit per service in the free account? I am running a cron job that involves a set of external API calls in a loop. However, it stops after executing 20 APIs. I have tested it locally, and it works fine. I would like to know the limitations of the Railway server. Project ID: dd417141-599f-4431-bbf6-538cbc507f1d
27 Replies
Percy
Percyβ€’2y ago
Project ID: dd417141-599f-4431-bbf6-538cbc507f1d
Brody
Brodyβ€’2y ago
railway has no limitations on the amount of calls your app can make to external services, you are likely being rate limited by the external service
malindu.dev
malindu.devOPβ€’2y ago
Thank you I'll check with them.
Brody
Brodyβ€’2y ago
what errors do you see on the 21st api call?
malindu.dev
malindu.devOPβ€’2y ago
No errors, Just stop
malindu.dev
malindu.devOPβ€’2y ago
I have added logs to monitor the pages. 1 page = 1 API call
Brody
Brodyβ€’2y ago
you probably aren't logging errors when they occur would you mind sharing what this external service is?
malindu.dev
malindu.devOPβ€’2y ago
yes, I have missed to add logs to see errors. I'll add and test again. CommerceLayer is the external service which I am using.
Brody
Brodyβ€’2y ago
and why the need for making consecutive api calls?
malindu.dev
malindu.devOPβ€’2y ago
They have a page limit, and we need to make multiple calls to retrieve all the data. Ex: "meta": { "record_count": 598, "page_count": 24 },
Brody
Brodyβ€’2y ago
they have that limit for a reason πŸ˜‰
malindu.dev
malindu.devOPβ€’2y ago
To get all 598 records, we have to call 24 times the API
Brody
Brodyβ€’2y ago
they obviously dont appreciate you scanning through all the pages and if they don't appreciate that kind of activity, railway wont appreciate that activity either
malindu.dev
malindu.devOPβ€’2y ago
I my business requirement, I have to gather all the data per 5min. πŸ™‚ This task is already working with Vercel, There I have to use multiple cron jobs to handle the load. Because they are having time limitations for long running services. That's the reason to move with Railway I'm not sure this time CommerceLayer side also having any issues, I'll talk with them also.
Brody
Brodyβ€’2y ago
very good chance they just tell you to stop scraping their api and thats kinda what im telling you too
malindu.dev
malindu.devOPβ€’2y ago
Without looping their API, There is no way to get all the data. That's the problem.
Brody
Brodyβ€’2y ago
the problem is why do you need to scrape their api for the data every 5 minutes
malindu.dev
malindu.devOPβ€’2y ago
I have to run 320 times to gather our production data πŸ˜…
Brody
Brodyβ€’2y ago
it also sounds like you should be on the railway teams plan
malindu.dev
malindu.devOPβ€’2y ago
Sorry, I can't explain the whole business logic in this thread. By the way, this is an API for extracting product details. When the product stock levels change from CommerceLayer side, we need to update our inventory every 5 minutes. Because Our inventory DB is the middleman used to expose stock levels to external services. Can you explain a bit why I need to move for Railway Teams plan?
Brody
Brodyβ€’2y ago
please find a different way to gather this data without loops, you are abusing CommerceLayer's api and CommerceLayer could decide to ban railway cloud, thus blocking anyone else on railway from using CommerceLayer the bigger issue is the abuse of CommerceLayer, but you would need to be on the teams plan because it sounds like you have a commercial product
malindu.dev
malindu.devOPβ€’2y ago
yes, I'll talk with our team, But this is my research to find a suitable service for our problem.
Brody
Brodyβ€’2y ago
in the interest of not getting external services to block railway, i will be asking the team to look into your use of the railway platform, no hard feelings
malindu.dev
malindu.devOPβ€’2y ago
Okay, no problem. I'll contact you again further more assistant on this case.
angelo
angeloβ€’2y ago
hey @Malindu - whats the purpose? Research, what university?
malindu.dev
malindu.devOPβ€’2y ago
I'm a kind of R&D developer, So, I'm researching a suitable service for the project.
luna
lunaβ€’2y ago
I would suggest looking at their rate limiting docs. You likely want to use an existing SDK or wrapper that handles the rate limiting headers and backs off accordingly. https://docs.commercelayer.io/core/rate-limits
Rate limits
Information about the restrictions on the number of times a user or client can access Commerce Layer API endpoints within a specified period of time.
Want results from more Discord servers?
Add your server