we have a system where we are calling a third party API, Upon reviewing response is very slow, before i could push the code to production, we have a local environment where we test our code before we pushed to live, in local environment its very fast, can anyone knows about the issue.
Without seeing how you are calling the API or the server configuration and server location + api server location, it's hard to tell what is happening here.
Also, consider that if you're using shared hosting, things will be, of course, slower.