ScrapeNinja

FREEMIUM
By Anthony | Updated 25 дней назад | Data
Popularity

9.9 / 10

Latency

3,767ms

Service Level

98%

Health Check

N/A

Back to All Discussions

why api unreachable?

Rapid account: Yijunli 1105 Jn Maz R Pc Ve
yijunli1105-jnMazRPc-Ve
2 года назад

{“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 года назад

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 года назад

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 года назад

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?

Join in the discussion - add comment below:

Login / Signup to post new comments