गूगल सर्च एपीआईक्विकस्टार्टशुरू करना

शुरुआत करें

एंडपॉइंट

POST https://api.scrapeless.com/api/v1/scraper/request

प्रत्येक अनुरोध को x-api-token हेडर के माध्यम से अपनी API कुंजी के साथ प्रमाणित करें।

अनुरोध बॉडी

पैरामीटरप्रकारविवरण
actorstringएक अत्यंत महत्वपूर्ण पैरामीटर जो चलाने के लिए सेवा का प्रतिनिधित्व करता है। Google Search API के लिए scraper.google.search का उपयोग करें।
inputobjectडेटा स्क्रैपिंग कार्य को पूरा करने के लिए एक्टर द्वारा आवश्यक पैरामीटर। API Parameters देखें।
proxyobjectcountry फ़ील्ड — अनुरोध भेजने के लिए इस क्षेत्र से एक प्रॉक्सी का उपयोग करें।

कार्य सफलता विवरण

  • 200 का HTTP कोड इंगित करता है कि कार्य सफल रहा है, और रिस्पॉन्स बॉडी में डेटा है।

कार्य प्रगति में विवरण

  • 201 का HTTP कोड इंगित करता है कि कार्य प्रसंस्करण में है। taskId के माध्यम से कार्य परिणाम प्राप्त करें।
{ "message": "task in progress", "taskId": "30681c8b-bfd3-48eb-a7c9-006e40b00591" }

कार्य विफलता विवरण

  • HTTP कोड 429, बहुत अधिक अनुरोध।
  • HTTP कोड 400, कृपया जांचें कि क्या कार्य पैरामीटर मान्य हैं।
  • HTTP कोड 500, आंतरिक सर्वर त्रुटि।

अनुरोध उदाहरण

Google Search डेटा प्राप्त करें

curl --location 'https://api.scrapeless.com/api/v1/scraper/request' \
--header 'x-api-token: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
    "actor": "scraper.google.search",
    "input": {
        "q": "coffee",
        "hl": "en",
        "gl": "us"
    }
}'

रिस्पॉन्स उदाहरण

एक सफल अनुरोध संरचित JSON लौटाता है। पठनीयता के लिए नीचे दिया गया उदाहरण छोटा किया गया है — लंबे base64 thumbnail/favicon मान छोटे कर दिए गए हैं, और दोहराए गए ऐरे आइटम छोड़ दिए गए हैं।

{
  "knowledge_graph": {
    "web_results": [
      {
        "link": "https://www.google.com/goto?url=CAESXAHrOzAVxWzBf4WvYxeVZ8Zo_Siv13akQaBbvGofI_ClLpVLHlRUsspJCVqpsphurR92LMRUV8EmuZ_IZ7lqN5pOWGRRLe7nEPPR6KjahnP1IVXaxsIqlP3xDakG"
      }
    ],
    "source": {}
  },
  "latest_posts": [
    {
      "title": "What's one coffee thing you used to care about that you don't anymore?",
      "link": "/goto?url=CAESmQEB6zswFVfIdcw56inl6eK4LHHs9d5OgGnu34d-gRX82gCIHEBAi7sC_8lq2bhRdqDC..."
    },
    {
      "title": "This Isn't Coffee. It's A Milkshake",
      "link": "/goto?url=CAESYwHrOzAVAkWf2LCzzmZ5cYYZHvuiF-TFXsr0xgPBY7amqrvK...",
      "duration": "14:02"
    }
  ],
  "local_map": {
    "link": "https://www.google.com/search?q=coffee&gl=us&hl=en&udm=1&...",
    "image": "data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",
    "gps_coordinates": null
  },
  "local_results": {
    "places": [
      {
        "position": 1,
        "rating": 4.9,
        "reviews": 404,
        "reviews_original": "(404)",
        "price": "$",
        "thumbnail": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAgGBhMSERQTERAT...",
        "gps_coordinates": { "latitude": 0, "longitude": 0 },
        "title": "Sip 305 (Kendall)",
        "type": " Coffee shop",
        "address": "Miami, FL",
        "phone": " $1–10 ",
        "hours": "4.9(404) ",
        "extensions": [
          "       \"Their coffee is so delicious and the customer service is always great.\""
        ]
      }
    ]
  },
  "metadata": {
    "engine": "google.search",
    "rawUrl": "https://api.scrapeless.com/storage/scrapeless.scraper.google.search/47c34678dc1d382b9c1d633559f82b89/b2472d195c682e2264ad95e0b8e7e9d9_1788487566.html"
  },
  "nutrition_information": {
    "description": "Coffee",
    "source": "USDA",
    "source_link": "google.com/goto?url=CAESbgHrOzAVw0vv2_vO0iW_QFtYMi1P7TFKGvdW231MF54OnwbaAfA...",
    "amount_per": "1 cup (8 fl oz) (237 g)",
    "calories": "1"
  },
  "organic_results": [
    {
      "position": 1,
      "title": "Coffee",
      "link": "https://en.wikipedia.org/wiki/Coffee",
      "redirect_link": "https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=CAESXAHrOzAVxWzBf4WvYxeVZ8Zo...",
      "favicon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAAAAABXZoBI...",
      "snippet": "Coffee is a beverage brewed from roasted, ground coffee beans. Dark-colored and bitter, coffee has a stimulating effect on humans due to its caffeine content;",
      "snippet_highlighted_words": [
        "a beverage brewed from roasted, ground coffee beans"
      ],
      "source": "Wikipedia"
    },
    {
      "position": 2,
      "title": "What is coffee? - NCA",
      "link": "https://www.aboutcoffee.org/origins/what-is-coffee/",
      "redirect_link": "https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=CAESawHrOzAVyp_BFOSj6O7zNYMsei_u8U1j8IcMB8f0Xqc6s67gnMuSxh70owMF6mQ0L1K0bm...",
      "favicon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+m...",
      "snippet": "What is coffee made of? Learn about the coffee tree, its lifespan, how it produces coffee beans, and the two most common coffee species, arabica and ...",
      "snippet_highlighted_words": [
        "Learn about the coffee tree, its lifespan, how it produces coffee beans"
      ],
      "source": "About Coffee - National Coffee Association"
    }
  ],
  "pagination": {
    "current": 1,
    "next": "https://www.google.com/search?q=coffee&gl=us&hl=en&start=10&...",
    "other_pages": {
      "2": "https://www.google.com/search?q=coffee&gl=us&hl=en&start=10&...",
      "3": "https://www.google.com/search?q=coffee&gl=us&hl=en&start=20&..."
    }
  },
  "search_information": {
    "organic_results_state": "Results for exact spelling",
    "query_displayed": "coffee",
    "total_results": 0,
    "time_taken_displayed": ""
  }
}