How to consume API - Content-Type: text/html; charset=utf-8

we are trying to consume an API that is Content-Type: text/html; charset=utf-8

but we can’t get the the json or XML

Hi Luis and welcome to the Community!

What exactly are you doing? A more detailed explanation with screenshots would be helpful.

These api’s are created by a software named Cyberquery, these api’s are given issues to get the data, which are supposed to show.

the response is the one in the image.

We use other api’s and we dont have issues.

regards

1 Like

You can’t parse the response with the “Parse JSON” action because the response is HTML (i.e. a web page), not JSON. You can see that by the <!DOCTYPE HTML> tag in the beginning of the response.

The API can probably be configured to return a response which format is defined by the Accept header of the request. I don’t see the contents of the “Headers” tab of the “Web request” action in your screenshot, but you can try adding the Accept header set to application/json as follows:

image

If application/json doesn’t work, try application/json to request a response in the XML format. In this case, you will need to parse it using the “Parse XML” action.

We try both suggestions, but have the same result

Then see the API documentation, or contact the API owner to figure out what headers the request should have in order to receive a JSON or XML response.

1 Like