Anmelden

API-Verwendung

Fügen Sie &scraper=bing-serp zu einem Crawling API-Request hinzu. URL-kodieren Sie die Ziel-URL im url-Parameter.

curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
  --data-urlencode 'url=https://www.bing.com/search?q=iphone' \
  --data-urlencode 'scraper=bing-serp' -G
from crawlbase import CrawlingAPI

api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
    'https://www.bing.com/search?q=iphone',
    {'scraper': 'bing-serp'}
)

import json
data = json.loads(res['body'])
const { CrawlingAPI } = require('crawlbase');
const api = new CrawlingAPI({ token: 'YOUR_TOKEN' });

const res = await api.get(
  'https://www.bing.com/search?q=iphone',
  { scraper: 'bing-serp' }
);
const data = JSON.parse(res.body);
require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')

res = api.get('https://www.bing.com/search?q=iphone', scraper: 'bing-serp')
data = JSON.parse(res.body)

Beispiel-Eingabe-URL

Die im url-Parameter übergebene URL (zur besseren Lesbarkeit URL-dekodiert):

https://www.bing.com/search?q=iphone

Response-Struktur

JSON-Response-Body. Feldtypen können null sein, wenn die Quellseite den Wert nicht enthält.

query
string
Suchanfrage.
total_results
integer | null
Gesamtanzahl der Ergebnisse.
organic
array
Organische Ergebnisobjekte.
organic[].title
string
Ergebnistitel.
organic[].url
string
Ziel-URL.
organic[].snippet
string
Snippet.
organic[].position
integer
Position (1-indexiert).
videos
array
Videoergebnisse.
related_searches
array
Verwandte Suchanfragen.

Beispiel-Response

{
  "query": "iphone",
  "organic": [
    {
      "title": "iPhone - Apple",
      "url": "https://www.apple.com/iphone/",
      "snippet": "Discover the new iPhone...",
      "position": 1
    }
  ],
  "related_searches": ["iphone 15", "iphone pro"]
}