JSON-Auto-Parser
Setzen Sie auto_parser=1, damit die API die Seite in eine verschachtelte JSON-Struktur aus Tags, Attributen und Text zerlegt. Funktioniert mit oder ohne JavaScript-Rendering.
Endpoint
Abschnitt betitelt „Endpoint“ GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>&auto_parser=1
Parameter
Abschnitt betitelt „Parameter“| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
api_key | string | ja | Ihr Web Scraping API-Schlüssel |
url | string | ja | Ziel-URL, die abgerufen werden soll |
auto_parser | integer | nein | 0 (Standard) oder 1. Wenn 1, wird die Antwort als geparstes JSON zurückgegeben. |
Beispielanfrage
Abschnitt betitelt „Beispielanfrage“curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://example.com&auto_parser=1"import requests
r = requests.get("https://scrape.shifter.io/v1", params={ "api_key": "YOUR_API_KEY", "url": "https://example.com", "auto_parser": 1,})print(r.json())import fetch from 'node-fetch';
const url = 'https://scrape.shifter.io/v1?' + new URLSearchParams({ api_key: 'YOUR_API_KEY', url: 'https://example.com', auto_parser: '1',});const res = await fetch(url);console.log(await res.json());Beispielantwort
Abschnitt betitelt „Beispielantwort“{ "0": { "tagName": "div", "children": { "0": { "tagName": "h1", "text": "Example Domain" }, "1": { "tagName": "p", "text": "This domain is for use in illustrative examples in documents." }, "2": { "tagName": "p", "text": "More information...", "children": { "0": { "tagName": "a", "attributes": { "href": "https://www.iana.org/domains/example" }, "text": "More information..." } } } } }}