Spicrawl अब OpenAI Agents SDK, LangChain, Codex, Claude Code और अन्य के साथ काम करता है।Integrations देखें
Content पर जाएँ

Batch web scraping API

एक call में 10,000 URLs तक भेजें। हर page साफ़ data के रूप में वापस पाएँ।

URLs submit करें
batch.py
import requestsjob = requests.post(    "https://api.spicrawl.com/v1/batch",    headers="Authorization": "Bearer spicrawl_live_…",    json={        "urls": ["https://example.com/one", "https://example.com/two"],        "js_render": True,    },).json()# Poll GET /v1/batch/{id} until status is "completed"print(job["id"], job["total_items"])

यह कैसे काम करता है

  1. अपने URLs भेजें POST /v1/batch पर। आपको तुरंत एक job ID वापस मिलती है।
  2. Job जाँचें जब तक उसका status completed, failed या cancelled न हो जाए।
  3. Results पढ़ें JSON Lines के रूप में, एक बार में एक page, X-Next-Cursor के साथ।
curl https://api.spicrawl.com/v1/batch \
  -H "Authorization: Bearer $SPICRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "catalog-refresh",
    "urls": ["https://example.com/products/1", "https://example.com/products/2"],
    "response_format": "markdown"
  }'

अपनी key SPICRAWL_API_KEY में रखें। आपकी key को batch scope चाहिए।

हर item क्या कर सकता है

  • Formats: html (default), markdown, text या json।
  • सफ़ाई: main_content_only, include_tags और exclude_tags Markdown और text पर काम करते हैं।
  • JavaScript: जिन pages को browser चाहिए उनके लिए js_render: true set करें।
  • प्रति-URL settings: हर URL को उसकी अपनी settings और एक external_id देने के लिए urls की जगह items भेजें।

जानने लायक बातें

  • Batch पर नहीं: extraction, screenshots, browser actions और sessions। जो job इन्हें माँगती है, उसे कुछ भी charge होने से पहले 400 के साथ refuse कर दिया जाता है। उन pages के लिए single scrapes इस्तेमाल करें।
  • Results expire हो जाते हैं job पूरी होने के 72 hours बाद।
  • Crawling नहीं। Spicrawl URLs नहीं ढूँढता और links follow नहीं करता। List आप भेजते हैं।
  • Pricing: beta के दौरान free। हर सफल item उतने ही credits लेता है जितने एक single scrape।

अक्सर पूछे जाने वाले सवाल

एक batch job में कितने URLs हो सकते हैं?

हर call में 10,000 URLs तक। उन्हें urls में list के रूप में भेजें, या items के रूप में जब हर URL को अपनी settings या match करने के लिए external_id चाहिए।

Batch job कौन से formats लौटाता है?

हर item html (default), markdown, text या json के रूप में आता है। Markdown और text वही conversion इस्तेमाल करते हैं जो single scrape में होता है।

Batch results कितने समय तक रखे जाते हैं?

For 72 hours after the job finishes. Read them with GET /v1/batch/{id}/results, which returns JSON Lines one page at a time.

क्या batch job fields निकाल सकता है या buttons click कर सकता है?

नहीं। Extraction, screenshots, browser actions और sessions batch पर नहीं चलते। जो job इन्हें माँगता है उसे कुछ भी charge होने से पहले 400 के साथ refuse कर दिया जाता है। उन pages के लिए single scrapes इस्तेमाल करें।

क्या batch पूरी website crawl करता है?

नहीं। Spicrawl URLs नहीं ढूँढता और links follow नहीं करता। आप अपनी चाही हुई URLs की list भेजते हैं।