ScrapeNinja

FREEMIUM
Par Anthony | Mise à jour 25 days ago | Data
Popularité

9.9 / 10

Latence

3,767ms

Niveau de service

98%

Health Check

N/A

Retour à toutes les discussions

why api unreachable?

{“messages”:“The API is unreachable, please contact the API provider”, “info”: “Your Client (working) —> Gateway (working) —> API (not working)”}
I’ve tried several times through the requests and httpx lib ,but it was still unreachable.

Rapid account: Restyler
restyler Commented 2 years ago

From your logs, I see you sometimes send “header” as a non-array (string) instead of “headers” and array ([])
For search engines like google.com and baidu I also recommend to provide “geo” : “ru” like this:

{
“url”: “https://www.google.com”,
“geo”: “ru”,
“headers”: [
“X-Header: some-random-header”
]
}

Rapid account: Yijunli 1105 Jn Maz R Pc Ve
yijunli1105-jnMazRPc-Ve Commented 2 years ago

it’s still not working…is there something wrong with my code?

import requests
url = “https://scrapeninja.p.rapidapi.com/scrape

payload = {
“url”: “https://www.google.com/”,
“header”: [
“X-Header: some-random-header”
]
}
headers = {
‘content-type’: “application/json”,
‘x-rapidapi-host’: “scrapeninja.p.rapidapi.com”,
‘x-rapidapi-key’: “###”
}

response = requests.request(“POST”, url, data=payload, headers=headers)

print(response.text)

Rapid account: Restyler
restyler Commented 2 years ago

hi! I see 502 for your requests but I can’t reproduce it while scraping the same website… apparently this was website or proxies downtime. Can you try again please and let me know?

Participez à la discussion - ajoutez un commentaire ci-dessous:

Connectez-vous / Inscrivez-vous pour publier de nouveaux commentaires