crawlbaseDocs
Anmelden

API-Nutzung

Fügen Sie &scraper=booking-hotel 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.booking.com/hotel/nl/example-amsterdam.html' \
  --data-urlencode 'scraper=booking-hotel' -G
from crawlbase import CrawlingAPI

api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
    'https://www.booking.com/hotel/nl/example-amsterdam.html',
    {'scraper': 'booking-hotel'}
)

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.booking.com/hotel/nl/example-amsterdam.html',
  { scraper: 'booking-hotel' }
);
const data = JSON.parse(res.body);
require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')

res = api.get('https://www.booking.com/hotel/nl/example-amsterdam.html', scraper: 'booking-hotel')
data = JSON.parse(res.body)

Beispiel-Eingabe-URL

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

https://www.booking.com/hotel/nl/example-amsterdam.html

Response-Struktur

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

name
string
Name des Hotels.
url
string
Kanonische Booking.com-URL des Hotels.
description
string
Vollständige Hotelbeschreibung.
address
string
Adresse des Hotels.
coordinates
object
Geografische Koordinaten des Hotels.
coordinates.latitude
number | null
Breitengrad des Hotels oder null, wenn nicht verfügbar.
coordinates.longitude
number | null
Längengrad des Hotels oder null, wenn nicht verfügbar.
rating
integer | null
Sterne-Rating des Hotels oder null, wenn nicht bewertet.
reviewScore
number | null
Durchschnittlicher Review-Score oder null, wenn keine Bewertungen vorliegen.
reviewCount
integer | null
Anzahl der Bewertungen oder null, wenn keine Bewertungen vorliegen.
reviewLabel
string | null
Textuelles Review-Label (zum Beispiel Superb), sofern vorhanden.
image
string | null
URL des Hauptbilds, sofern vorhanden.
facilities
array
Namen der vom Hotel angebotenen Ausstattungsmerkmale.

Beispiel-Response

{
  "name": "Canal House Amsterdam",
  "url": "https://www.booking.com/hotel/nl/example-amsterdam.html",
  "description": "A restored 17th-century canal house in the heart of Amsterdam, steps from the Jordaan district. Rooms overlook the Keizersgracht with original beamed ceilings and a private garden terrace.",
  "address": "Keizersgracht 148, Amsterdam City Center, 1015 CX Amsterdam, Netherlands",
  "coordinates": {
    "latitude": 52.3738,
    "longitude": 4.8846
  },
  "rating": 4,
  "reviewScore": 9.1,
  "reviewCount": 1284,
  "reviewLabel": "Superb",
  "image": "https://cf.bstatic.com/xdata/images/hotel/canal-house.jpg",
  "facilities": [
    "Free WiFi",
    "Non-smoking rooms",
    "Garden",
    "Bar",
    "Family rooms",
    "24-hour front desk"
  ]
}