Resolved URL
Scraping Fish returns the final resolved URL after any redirects.
This information can be found in the Resolved-Url
header of the API response.
Resolved URL is included in the response header every time and there is no additional parameter needed to enable it.
Example
For URL http://google.com, Google redirects to HTTPS which is included in the response:
- Python
- NodeJS
- cURL
import requests
payload = {
"api_key": "[your API key]",
"url": "http://google.com",
}
response = requests.get("https://scraping.narf.ai/api/v1/", params=payload)
print(response.headers)
const axios = require("axios");
const payload = {
api_key: "[your API key]",
url: "http://google.com",
};
const response = await axios.get("https://scraping.narf.ai/api/v1/", { params: payload });
console.log(response.headers);
curl -G --head --data-urlencode 'url=http://google.com' \
'https://scraping.narf.ai/api/v1/?api_key=[your API key]'
Response headers:
Content-Type: text/html; charset=utf-8
...
Resolved-Url: https://www.google.com/?gws_rd=ssl
...
Content-Length: 39