POST /ai-summarize

AI Summarize

Summarize any web page or article by URL: choose length, format, language, and add your own instructions.

Article Summarizer API

Fetch any URL and receive its summary as text, not JSON. Choose length (short, medium, long) or an exact max_words target, the format (plain text or markdown) and the language (defaults to the page’s own). Add free-text instructions to steer the summary: what to focus on, the audience or tone, a question to answer from the page. The response also includes key_points (the bullet form of the summary), the page title and the detected language.

HTTP Request

Send the parameters as a JSON body. The same parameters are also accepted as query-string parameters on a GET request. Same handler, same billing, same errors.

1
POST /ai-summarize

Parameters

ParameterTypeRequiredDefaultDescription
urlstringYesAbsolute http(s) URL to fetch. URL-encode it on GET if it has its own query string
lengthstringNomediumHow long: short is about 1-2 sentences (about 60 words), medium is about one paragraph (about 150 words), long is 3-5 short paragraphs (about 400 words). A target the model aims for, not a hard limit. Ignored when max_words is set
max_wordsintegerNoWord target (20-1000) that overrides length. Plain text lands within about 10% of the target; markdown and non-English output can run about 30% over. The text is never cut, treat it as a target, not a hard limit
formatstringNotextShape of summary: text (plain prose) or markdown (prose with light markdown, short headings and emphasis). The bullet form is always available in key_points
languagestringNopage’s languageLanguage to write the summary in, as a lowercase ISO-639-1 code with optional region (en, es, pt-BR). Omit to use the page’s own language
instructionsstringNoExtra instructions, max 1000 characters: what to focus on (pricing and delivery), audience or tone (for a 10-year-old), a question to answer from the page (what does it say about refunds?), things to leave out. The summary never invents facts that are not on the page: if the page does not cover what you ask, it says so
render_jsstringNoautofalse = plain HTTP fetch; true = headless browser rendering; auto = HTTP first, browser only if blocked
proxy_typestringNodatacenterdatacenter or isp (static-residential exits, higher trust with strict targets, higher credit cost)
session_idstringNoSticky handle (1-64 chars A-Za-z0-9_-): the same value always routes through the same outbound IP. Omit to get a fresh one; the id used is returned in data.session_id
cookiesobject / string / arrayNoCookies to send: object, a=1; b=2 string, or a list of {name, value} objects. Only used on the HTTP path. GET form: the cookie string
user_agentstringNoUser-Agent to send. Drives the TLS and header fingerprint automatically. Only used on the HTTP path
headersobjectNoExtra request headers. Reserved names (Host, Cookie, User-Agent, Content-Length, sec-, x-forwarded-, cf-*, Authorization) are rejected. GET form: a JSON object string
methodstringNoGETHTTP method used against the target: GET or POST
bodystringNoRequest body sent to the target when method is POST. Requires a Content-Type in headers
wait_forstringNoBrowser path only: after the page loads, wait for this CSS selector to appear before capturing (lazy-loaded content). Waits at most 15 s and never past timeout
timeoutintegerNo25Total budget in seconds for the whole request, fetch and rendering included (max 27)
fieldsstringNoComma-separated allow-list of data keys to return, e.g. summary,key_points. Unknown names return a 400 listing the valid ones

Response

The response returns a JSON object with the summary plus fetch details.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  "status": true,
  "request_id": "0f3c9d2a",
  "data": {
    "url": "https://en.wikipedia.org/wiki/Web_scraping",
    "http_status": 200,
    "summary": "El **web scraping** es la extracción automatizada de datos de sitios web… Su legalidad varía según el país…",
    "key_points": [
      "Extracción automatizada de datos web mediante bots",
      "La legalidad depende de la jurisdicción y de los términos del sitio"
    ],
    "language": "es",
    "title": "Web scraping - Wikipedia",
    "truncated": false,
    "ai_error": null,
    "blocked": false,
    "block_reason": null,
    "detected_protection": null,
    "render_used": "http",
    "credits": 6,
    "elapsed_ms": 2994,
    "session_id": "b0d1b2b8ee0d0b0e",
    "proxy_type": "datacenter"
  }
}

Response Fields

FieldTypeDescription
statusbooleantrue when the summary was produced; false when data.ai_error is set
request_idstringUnique identifier for the request
data.urlstringFinal URL after redirects
data.http_statusintegerHTTP status the site returned for the final document, never masked
data.summarystring | nullThe summary, in the requested format and language. Null when no summary was produced (see ai_error)
data.key_points[]array3-7 short takeaways from the page, in page order (the bullet form of the summary). Empty when summary is null
data.languagestring | nullLanguage the summary is written in, as an ISO-639-1 code; null when unknown
data.titlestring | nullThe page <title>; null when the page has none
data.truncatedbooleanTrue when the page was longer than the model budget and only its first part was summarized. Never about the summary’s own length
data.ai_errorstring | nullSet when summary is null although a page was fetched: blocked, empty_page, llm_timeout, llm_error or invalid_output. See Error Responses below
data.blockedbooleanTrue when the site served an anti-bot challenge or rejection instead of content
data.block_reasonstring | nullWhy it was considered blocked, a stable slug (cloudflare_challenge, captcha, rate_limited, forbidden, …); null when not blocked
data.detected_protectionstring | nullAnti-bot vendor detected on the page (cloudflare, akamai, datadome, perimeterx, incapsula). Informational: it does not mean the request was blocked
data.render_usedstringWhich path fetched the page: plain http or headless browser rendering
data.creditsintegerRequests billed for this call. 0 when the target blocked the request
data.elapsed_msintegerTotal time the request took, fetch and summary included, in milliseconds
data.session_idstringSticky-session handle used for this request. Reuse it to keep the same outbound IP
data.proxy_typestringProxy pool this request went out of

Error Responses

Errors use a consistent envelope: {"status": false, "error": "description", "request_id": "..."}.

CodeWhen
400Invalid request (bad URL, reserved header, out-of-range timeout, unknown fields name, invalid language code, body without a Content-Type), or the URL points at a non-public address
415The URL returned a non-textual document (for example image/png)
502The target could not be fetched. The body reads could not fetch target: <reason> where <reason> is a fixed slug (DNS failure, connection refused, TLS error, timeout), never raw library text
503Service temporarily unavailable (our infrastructure, not the target)

Thin pages: a page with no readable text, common for script-rendered pages fetched over plain HTTP, returns HTTP 200 with summary: null and ai_error: "empty_page". Retry with render_js=true.

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import requests

url = "https://ai-article-extractor-scraper-and-summarizer-api.p.rapidapi.com/ai-summarize"

payload = {
    "url": "https://www.bbc.com/news/articles/c5y6znym0e6o",
    "max_words": 120,
    "format": "text"
}

headers = {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "ai-article-extractor-scraper-and-summarizer-api.p.rapidapi.com",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, json=payload)
data = response.json()["data"]

print(data["title"])
print(data["summary"])
for point in data["key_points"]:
    print(f"- {point}")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
const url = "https://ai-article-extractor-scraper-and-summarizer-api.p.rapidapi.com/ai-summarize";

const response = await fetch(url, {
  method: "POST",
  headers: {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "ai-article-extractor-scraper-and-summarizer-api.p.rapidapi.com",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://www.bbc.com/news/articles/c5y6znym0e6o",
    max_words: 120,
    format: "text",
  }),
});

const { data } = await response.json();

console.log(data.title);
console.log(data.summary);
data.key_points.forEach((point) => console.log(`- ${point}`));
1
2
3
4
5
6
7
8
9
curl -X POST "https://ai-article-extractor-scraper-and-summarizer-api.p.rapidapi.com/ai-summarize" \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: ai-article-extractor-scraper-and-summarizer-api.p.rapidapi.com" \
  -d '{
    "url": "https://www.bbc.com/news/articles/c5y6znym0e6o",
    "max_words": 120,
    "format": "text"
  }'
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI