Amazon

フリーミアム
よって Anton | 更新済み 3ヶ月前 | eCommerce
人気

9.7 / 10

レイテンシー

5,265ms

サービスレベル

100%

すべてのディスカッションに戻る

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object

avatar
gtardy
3ヶ月前

I keep getting the same error (see title above), yet RapidAPI treats it as any other chargeable API call.

As I understand it, the error is raised by ScrapeNinja. Yet the “data” argument should be unnecessary for a GET request, according to API Documentation.

The environment is Node.js using request with the following options :

{
method: ‘POST’,
uri: ‘https://scrapeninja.p.rapidapi.com/scrape’,
headers: {
‘content-type’: ‘application/json’,
‘X-RapidAPI-Host’: ‘scrapeninja.p.rapidapi.com’,
‘X-RapidAPI-Key’: ‘MY_API_KEY_HERE’,
useQueryString: true
},
body: {
geo: ‘de’,
url: ‘https://ANY_WEBSITE_HERE’,
headers: [
‘User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36’,
‘Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8’,
‘Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6,de-CH;q=0.5’,
]
},
useQueryString: true,
json: true
encoding: null,
gzip: true,
forever: true,
jar: true,
timeout: 60000,
simple: false,
resolveWithFullResponse: true,
}

avatar
restyler commented 3ヶ月前

Hi! This is the Amazon API support forum, and not ScrapeNinja API support 😃

I see you are doing successful requests now, hopefully you figured out this one.

“data” is indeed only required for POST so it’s probably something wrong with your payload.
If you are still in trouble, please send your code to https://t.me/instalyze so I can investigate.

Good luck!

ディスカッションに参加しましょう-以下にコメントを追加してください:

ログイン/サインアップして新しいコメントを投稿
評価:3-投票:3