Docs
Anmelden

Endpoint

HTTPSsmartproxy.crawlbase.com:8013
HTTPsmartproxy.crawlbase.com:8012
  • Bevorzugen Sie den HTTPS-Proxy auf Port 8013 (empfohlen). Der HTTP-Proxy auf Port 8012 steht für Clients zur Verfügung, die nur HTTP zu Upstream-Proxys sprechen.
  • Authentifizieren Sie sich mit Ihrem Token als Benutzername; lassen Sie das Passwort leer.
  • Beide Ports funktionieren mit jeder Ziel-URL, HTTP oder HTTPS.

Schnellstart

Konfigurieren Sie Smart AI Proxy als Proxy in Ihrem HTTP-Client. Das ist die komplette Einrichtung.

TLS-Verifizierung deaktivieren

Smart AI Proxy fängt TLS-Verbindungen ab, um Proxy-Header hinzuzufügen. Ihr Client sieht das Zertifikat von Crawlbase statt das des Ziels, setzen Sie daher verify=False / InsecureSkipVerify: true / das entsprechende Äquivalent. Die Verbindung von Crawlbase zur Zielseite wird weiterhin verifiziert.

curl -x 'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013' \
     -k 'https://httpbin.org/ip'
import requests

proxies = {
    'http':  'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013',
    'https': 'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013',
}
res = requests.get('https://httpbin.org/ip', proxies=proxies, verify=False)
print(res.text)
const { HttpsProxyAgent } = require('https-proxy-agent');

const agent = new HttpsProxyAgent(
  'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013'
);

const res = await fetch('https://httpbin.org/ip', { agent });
console.log(await res.text());
require 'net/http'

uri = URI('https://httpbin.org/ip')
proxy = Net::HTTP::Proxy('smartproxy.crawlbase.com', 8013, 'YOUR_TOKEN', '')
http = proxy.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
puts http.get(uri.request_uri).body
package main

import (
    "crypto/tls"
    "fmt"
    "io"
    "net/http"
    "net/url"
)

func main() {
    proxyURL, _ := url.Parse("https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013")
    client := &http.Client{Transport: &http.Transport{
        Proxy:           http.ProxyURL(proxyURL),
        TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
    }}
    res, _ := client.Get("https://httpbin.org/ip")
    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}

POST-Requests

Smart AI Proxy leitet POST-Requests genauso wie jede andere HTTP-Methode an das Ziel weiter. Stellen Sie den Proxy in Ihrem Client ein und senden Sie POST-Requests wie gewohnt - der Proxy behält Ihre Methode, Header und den Body bei. Die Beispiele unten decken die beiden Body-Formate ab, die die meisten Clients verwenden: form-encoded und JSON.

Form-encoded body

# HTTPS proxy on :8013 (use http:// + :8012 for HTTP-only clients)
curl -X POST \
     -H 'Content-Type: application/x-www-form-urlencoded' \
     -F 'param=value' \
     -x 'https://[email protected]:8013' \
     -k 'https://httpbin.org/anything'
import requests
from urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)

proxies = {
    'http':  'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013',
    'https': 'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013',
}
res = requests.post(
    'https://httpbin.org/anything',
    data={'param': 'value'},
    proxies=proxies,
    verify=False,
)
print(res.status_code, res.text)
const { HttpsProxyAgent } = require('https-proxy-agent');
const querystring = require('querystring');

const agent = new HttpsProxyAgent(
  'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013'
);
const res = await fetch('https://httpbin.org/anything', {
  method: 'POST',
  headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  body: querystring.stringify({ param: 'value' }),
  agent,
});
console.log(res.status, await res.text());
require 'net/http'
require 'openssl'
require 'uri'

uri = URI('https://httpbin.org/anything')
proxy = Net::HTTP::Proxy('smartproxy.crawlbase.com', 8013, 'YOUR_TOKEN', '')
http = proxy.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

req = Net::HTTP::Post.new(uri.request_uri)
req.set_form_data('param' => 'value')
res = http.request(req)
puts res.code, res.body
package main

import (
    "crypto/tls"
    "fmt"
    "io"
    "net/http"
    "net/url"
    "strings"
)

func main() {
    proxyURL, _ := url.Parse("https://[email protected]:8013")
    client := &http.Client{Transport: &http.Transport{
        Proxy:           http.ProxyURL(proxyURL),
        TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
    }}

    data := url.Values{}
    data.Set("param", "value")
    req, _ := http.NewRequest("POST",
        "https://httpbin.org/anything",
        strings.NewReader(data.Encode()))
    req.Header.Set("Content-Type", "application/x-www-form-urlencoded")

    res, _ := client.Do(req)
    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)
    fmt.Println(res.Status, string(body))
}

JSON body

curl -X POST \
     -H 'Content-Type: application/json' \
     --data '{"key1":"value1","key2":"value2"}' \
     -x 'https://[email protected]:8013' \
     -k 'https://httpbin.org/anything'
import requests
proxies = {
    'http':  'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013',
    'https': 'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013',
}
res = requests.post(
    'https://httpbin.org/anything',
    json={'key1': 'value1', 'key2': 'value2'},
    proxies=proxies,
    verify=False,
)
print(res.status_code, res.text)
const { HttpsProxyAgent } = require('https-proxy-agent');

const agent = new HttpsProxyAgent(
  'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013'
);
const res = await fetch('https://httpbin.org/anything', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ key1: 'value1', key2: 'value2' }),
  agent,
});
console.log(res.status, await res.text());
require 'net/http'
require 'json'
require 'openssl'
require 'uri'

uri = URI('https://httpbin.org/anything')
proxy = Net::HTTP::Proxy('smartproxy.crawlbase.com', 8013, 'YOUR_TOKEN', '')
http = proxy.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

req = Net::HTTP::Post.new(uri.request_uri,
                          'Content-Type' => 'application/json')
req.body = { key1: 'value1', key2: 'value2' }.to_json
puts http.request(req).body

Header und Cookies weiterleiten

Smart AI Proxy reicht die meisten Header und Cookies Ihres ausgehenden Requests an das Ziel weiter, sodass bestehende Clients ohne Anpassungen weiterarbeiten. Zwei bemerkenswerte Verhaltensweisen:

  • Ihr User-Agent wird unverändert weitergeleitet. Senden Sie einen leeren und der Proxy rotiert einen realistischen UA für Sie.
  • Hop-by-Hop- und Proxy-Control-Header (Host, Proxy-Authorization) werden entfernt - sie beschreiben den Proxy selbst, nicht den weitergeleiteten Request.
curl -H 'Accept-Language: en-US,en;q=0.9' \
     -H 'X-Custom-Header: My-Custom-Value' \
     -H 'User-Agent: MyCustomBrowser/1.0' \
     --cookie 'sid=abc123; cart=xyz789' \
     -x 'https://[email protected]:8013' \
     -k 'https://httpbin.org/anything'

Das obige Beispiel kommt am Ziel mit allen vier Custom-Headern und beiden Cookies unverändert an. Um das Proxy-Verhalten zu überschreiben (Land, Gerät, Session, JS-Rendering, Scrapers usw.), verwenden Sie stattdessen die CrawlbaseAPI-*-Header - diese werden vom Proxy interpretiert und erreichen das Ziel nie.

Headless-Browser-Rendering

Smart AI Proxy wird von derselben Headless-Browser-Flotte betrieben wie die Crawling API. Um JavaScript auszuführen, client-gerenderte SPAs zu erfassen oder Crawling-API-Features anzuwenden, die einen echten Browser erfordern (Screenshots, Scrollen, Click-Selektoren, Autoparse), übergeben Sie CrawlbaseAPI-Parameters: javascript=true als Header in Ihrem ausgehenden Request.

# Render with a headless browser, force a 2s wait, scroll to load lazy content
curl -H 'CrawlbaseAPI-Parameters: javascript=true&page_wait=2000&scroll=true' \
     -x 'https://[email protected]:8013' \
     -k 'https://spa.example.com/feed'

Verwenden Sie Ihr JavaScript token (nicht das Normal token), wenn javascript=true gesetzt ist - sie werden separat abgerechnet. Der vollständige Satz von Browser-Tier-Parametern (page_wait, scroll, css_click_selector, wait_for, Screenshots) ist über CrawlbaseAPI-Parameters erreichbar; siehe die JavaScript-Parameter-Referenz für die vollständige Liste.

Wann Smart AI Proxy vs. Crawling API verwenden

Smart AI Proxy und die Crawling API laufen im selben Netzwerk und bieten denselben Funktionsumfang - JS-Rendering, Anti-Bot-Bypass, Country-Routing, Geräte-Emulation, Sessions, Scrapers, async + Storage, alles davon. Die Wahl zwischen beiden ist keine Frage der Funktionalität, sondern hängt von der Interface-Form, der Subscription, die Sie haben, und dem Concurrency-Tier ab, den diese Subscription bietet.

Wählen Sie Smart AI Proxy, wenn …Wählen Sie die Crawling API (REST), wenn …
Sie den Client-Code nicht ändern können (Drittanbieter-Tool, Browser-Extension, Scrapy, ein bestehender Scraper)Sie von Grund auf neu bauen und explizite Kontrolle pro Request wünschen
Sie lieber einmal einen Proxy konfigurieren, als jeden Request auf einen neuen Endpoint umzuschreibenSie lieber URL und Parameter im Klartext als GET-Form für Logging / Debugging sehen
Ihr Abonnement der Smart-AI-Proxy-Plan ist, mit eigener Thread- / Concurrency-StufeIhr Abonnement auf dem Crawling API-Plan ist, mit eigenem monatlichem Kontingent und Concurrency-Budget
Sie Crawlbase ohne Code-Änderungen vor eine bestehende Pipeline schalten möchtenSie möchten, dass eines der SDKs Retries, async Polling und Response-Parsing für Sie übernimmt

Alle Crawling-API-Parameter sind von Smart AI Proxy aus über den CrawlbaseAPI-Parameters-Header erreichbar (siehe unten). Der Funktionsumfang ist derselbe - wählen Sie die Variante, die Ihre Subscription und Integrationsform bevorzugt.

Control-Header

Übergeben Sie Custom-Header mit dem Präfix CrawlbaseAPI- in Ihrem ausgehenden Request, um das Proxy-Verhalten zu steuern. Die drei Single-Purpose-Header unten sind komfortable Shortcuts; der vollständige Crawling API-Parametersatz ist über CrawlbaseAPI-Parameters erreichbar (nach der Tabelle dokumentiert).

CrawlbaseAPI-Country
ISO 3166optional
Erzwingt ein bestimmtes Land: US, GB, DE usw.
CrawlbaseAPI-Device
desktop | mobiledesktop
Emuliert die Geräteklasse.
CrawlbaseAPI-Session-Id
stringoptional
Bindet eine Session an dieselbe Exit-IP. Nützlich für mehrstufige Flows, die eine stabile Identität benötigen. Sessions leben ca. 30 Minuten.
CrawlbaseAPI-Parameters
query stringoptional
Der vollständige Crawling-API-Parametersatz, übergeben als einzelner mit Ampersand verbundener String. Alles, was Sie an einen REST-Request anhängen würden - javascript=true, page_wait=2000, scroll=true, store=true, &scraper=amazon-product-details, autoparse=true: funktioniert hier. Kombinieren Sie mehrere mit &, z. B. "javascript=true&country=US&store=true".

CrawlbaseAPI-Parameters verwenden

Die obigen Single-Purpose-Header (Country, Device, Session-Id) sind Abkürzungen für die häufigsten Steuerungen. Alles andere aus dem Crawling-API-Parametersatz - JS-Rendering, Scroll, Click-Selectors, Scrapers, async + Webhooks + Storage, get_cookies, get_headers - ist über den CrawlbaseAPI-Parameters-Header erreichbar. Das Format ist derselbe Query-String, den Sie an einen REST-Aufruf anhängen würden:

# JS-rendered SPA, store the result, force US geo
curl -x 'https://YOUR_JS_TOKEN:@smartproxy.crawlbase.com:8013' \
     -H 'CrawlbaseAPI-Parameters: javascript=true&country=US&store=true&page_wait=2000' \
     -k 'https://spa.example.com/feed'

# Apply a scraper - same as &scraper=… on the REST endpoint
curl -x 'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013' \
     -H 'CrawlbaseAPI-Parameters: scraper=amazon-product-details' \
     -k 'https://www.amazon.com/dp/B0CHX2XFLN'

Konfliktauflösung: Wenn Sie sowohl einen Single-Purpose-Header (z. B. CrawlbaseAPI-Country: GB) als auch dasselbe Feld innerhalb von CrawlbaseAPI-Parameters übergeben, gewinnt der Single-Purpose-Header. Wählen Sie pro Request einen Stil, um das Verhalten vorhersehbar zu halten.

# Pin to a US session for a multi-step checkout flow
curl -x 'https://YOUR_TOKEN:@smartproxy.crawlbase.com:8013' \
     -H 'CrawlbaseAPI-Country: US' \
     -H 'CrawlbaseAPI-Session-Id: checkout-user-42' \
     -k 'https://shop.example.com/cart'

Fehler

Smart AI Proxy gibt standardmäßige HTTP-Responses zurück. Die Statuscodes folgen demselben Modell wie bei der Crawling API. Auth-Fehler (401, 402) werden vom Proxy selbst zurückgegeben; Seitenfehler (404, 500 usw.) kommen vom Ziel.