How to disable redirect?

I am trying to create a php API to use with a Lua program. but whenever i do a GET request to my api, i get a Javascript program. i am aware that this happens all the time when people connect to my site. But i would like to know if there is any way to disable it. if so can anyone please tell me ?

I think this FAQ article answers your question: https://infinityfree.net/support/javascript-error-using-api-or-mobile-android-app