Skip to main content
POST
/
web-scraping
cURL
curl --request POST \
  --url https://api.geekflare.com/web-scraping \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "url": "https://example.com",
  "device": "desktop",
  "blockAds": true,
  "renderJS": true,
  "proxyCountry": "us",
  "format": "html",
  "fileOutput": false,
  "extractionMode": "default",
  "extractionSchema": {
    "name": "Product Schema",
    "fields": [
      {
        "title": "Product Name",
        "value": "Some hardcoded string"
      }
    ],
    "baseSelector": ".product"
  }
}
'
{
  "timestamp": 1763372588297,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "https://example.com",
    "device": "desktop",
    "format": "html",
    "fileOutput": false,
    "blockAds": true,
    "renderJS": true,
    "extractionMode": "default",
    "extractionSchema": {
      "name": "Product Schema",
      "fields": [
        {
          "title": "Product Name",
          "value": "Some hardcoded string"
        }
      ],
      "baseSelector": ".product"
    },
    "test": {
      "id": "mxqx9v9y0742lap6altwdteqd28t23nq"
    },
    "proxyCountry": "<string>"
  },
  "data": "https://example.com/9bulgk075ed9m3vhua5vcrp0.html"
}

Authorizations

x-api-key
string
header
required

API Key required for all endpoints

Body

application/json
url
string
required

Target URL

Example:

"https://example.com"

device
enum<string>
default:desktop

Device type to emulate. Defaults to desktop.

Available options:
desktop,
mobile
Example:

"desktop"

blockAds
boolean
default:true

Whether to block ads

Example:

true

renderJS
boolean
default:true

Whether to render JavaScript

Example:

true

proxyCountry
string

Proxy country code to route the request

Example:

"us"

format
enum<string>
default:html

Format of the scraped result. Defaults to html.

Available options:
html,
markdown,
json,
markdown-filtered,
all
Example:

"html"

fileOutput
boolean
default:false

Whether to get response in file format

Example:

false

extractionMode
enum<string>
default:default

Extraction mode (only used if format=json)

Available options:
default,
cssSchema,
xpathSchema
Example:

"default"

extractionSchema
object

Extraction schema (optional in default mode, required in css/xpath)

Response

Successfully scraped webpage

timestamp
number
required

Timestamp of the request in milliseconds

Example:

1763372588297

apiStatus
enum<string>
required

API status message

Available options:
success,
failure
Example:

"success"

apiCode
number
required

API status code

Example:

200

meta
object
required

Metadata about the request

data
required

Scraped data (URL or inline content depending on output)

Example:

"https://example.com/9bulgk075ed9m3vhua5vcrp0.html"