To start, create a custom service that triggers a post request whenever your script is executed. Assuming you are working with Node.js, you can define a module like APIHandler. Within this module, make sure to establish a mechanism for sending an HTTP request.
For handling the requests, I recommend utilizing the request module. Upon invocation of this function, it will yield a promise containing a JSON string. This string holds a plethora of data that can be parsed into a JavaScript object using JSON.parse.
Nevertheless, it is important to clarify that the API's functionality may not align with your expectations. While it can provide nutritional details based on a list of ingredients, it does not perform food categorization.