Request

Scrape any URL using Serply servers with automatic captcha bypass. This endpoint is perfect for extracting content from websites for AI and LLM applications.

Endpoint

POST /v1/request

Description

The Request endpoint allows you to scrape content from any URL using Serply's servers. This endpoint automatically bypasses most captchas and is optimized for extracting content that can be used with AI and LLM applications. You can choose to receive the content in either full HTML format or as markdown.

Authentication

All requests require authentication using the X-Api-Key header. See the Authentication guide for more details.

Request Body Parameters

The request body must be JSON with the following parameters:

url (required)

Type: string

The URL to scrape. Provide the URL as a plain string in the JSON body.

Examples:

  • https://serply.io/
  • https://serply.io/pricing
  • https://news.ycombinator.com/item?id=12345678

response_type (required)

Type: string

The format of the response content.

Allowed values:

  • "full" - Returns the full HTML content of the page
  • "markdown" - Returns the content converted to markdown format (ideal for AI/LLM processing)

Request Examples

Using cURL

Full Response Type

curl --request POST \
  --url 'https://api.serply.io/v1/request' \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --data '{
    "url": "https://serply.io/",
    "response_type": "full"
  }'

Markdown Response Type

curl --request POST \
  --url 'https://api.serply.io/v1/request' \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --data '{
    "url": "https://serply.io/",
    "response_type": "markdown"
  }'

Using JavaScript/Node.js

Full Response Type

const response = await fetch('https://api.serply.io/v1/request', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    url: 'https://serply.io/',
    response_type: 'full'
  })
});

const data = await response.json();
console.log(data);

Markdown Response Type

const response = await fetch('https://api.serply.io/v1/request', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    url: 'https://serply.io/',
    response_type: 'markdown'
  })
});

const data = await response.json();
console.log(data);

Using Python

Full Response Type

import requests
import json

url = "https://api.serply.io/v1/request"
headers = {
    "Content-Type": "application/json",
    "X-Api-Key": "YOUR_API_KEY"
}
payload = {
    "url": "https://serply.io/",
    "response_type": "full"
}

response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)

Markdown Response Type

import requests
import json

url = "https://api.serply.io/v1/request"
headers = {
    "Content-Type": "application/json",
    "X-Api-Key": "YOUR_API_KEY"
}
payload = {
    "url": "https://serply.io/",
    "response_type": "markdown"
}

response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)

Response

The API returns a JSON object containing the scraped content in the requested format.

Response Structure

Full Response Type

{
  "content": "<html>...</html>",
  "url": "https://serply.io/",
  "response_type": "full"
}

Markdown Response Type

{
  "content": "# Article Title\n\nArticle content in markdown format...",
  "url": "https://serply.io/",
  "response_type": "markdown"
}

Response Fields

  • content (string): The scraped content in the requested format (HTML for "full", markdown for "markdown")
  • url (string): The URL that was scraped
  • response_type (string): The response type that was requested ("full" or "markdown")

Example Response (Markdown)

{
  "content": "# Serply\n\nSerply is a powerful API for web scraping and search...",
  "url": "https://serply.io/",
  "response_type": "markdown"
}

Status Codes

  • 200 OK - Successful response
  • 400 Bad Request - Invalid parameters (missing or invalid URL, invalid response_type)
  • 401 Unauthorized - Invalid or missing API key
  • 404 Not Found - The requested URL could not be accessed
  • 429 Too Many Requests - Rate limit exceeded

Error Responses

See the Errors guide for information on error response formats.