ユニバーサルスクレイピングAPIクイックスタートはじめる

はじめに

パラメータの説明

パラメータ説明
actorstring非常に重要なパラメータで、サービスを表します。スクレイパーのアクターリスト情報を表示するにはクリックしてください
inputobjectデータスクレイピングタスクを完了するためにアクターが必要とするパラメータ。
proxyobjectcountry フィールド。この地域のプロキシを使用してリクエストを送信します。

input フィールドの説明

パラメータデフォルト説明
urlstringターゲットウェブサイト
methodstringGETリクエストメソッド
redirectbooleanfalseリダイレクトを許可するかどうか
headersobjectカスタムリクエストヘッダーフィールド

最初のリクエストを送信する

https://httpbin.io/get のデータスクレイピングを例として使用します。

API エンドポイント経由でデータを取得する

import { Scrapeless } from '@scrapeless-ai/sdk';
 
const client = new Scrapeless({
  apiKey: 'YOUR_API_KEY'
});
 
client.universal.scrape({
   actor: "unlocker.webunlocker",
   input: {
      url: "https://httpbin.io/get",
      redirect: False,
      method: "GET",
   },
   proxy: {
      country: "ANY",
   }
}).then(async (result) => {
    console.log(result);
  })
  .catch((error) => {
    console.error('Error:', error);
  });