curl --request POST \
--url https://api.rankspot.ai/v1/research/fetch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/blog/post"
}
'import requests
url = "https://api.rankspot.ai/v1/research/fetch"
payload = { "url": "https://example.com/blog/post" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/blog/post'})
};
fetch('https://api.rankspot.ai/v1/research/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rankspot.ai/v1/research/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/blog/post'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.rankspot.ai/v1/research/fetch"
payload := strings.NewReader("{\n \"url\": \"https://example.com/blog/post\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.rankspot.ai/v1/research/fetch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/blog/post\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rankspot.ai/v1/research/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/blog/post\"\n}"
response = http.request(request)
puts response.read_body{
"markdown": "# Best screen recorders for Mac\n\nIf you are looking for..."
}Fetch a page as text
Fetches one public URL and returns its main content as markdown. That is the whole response: { "markdown": "# ..." }. Two providers are tried in turn, so pages that block the first one (Reddit, most notably) still come back, and which one answered is not something the caller has to care about. Costs credits at a flat rate per fetch however many providers it took, charged whenever a page comes back. Use it to settle a specific question rather than to crawl: one page, one charge. Returns 402 when the workspace has none left.
curl --request POST \
--url https://api.rankspot.ai/v1/research/fetch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/blog/post"
}
'import requests
url = "https://api.rankspot.ai/v1/research/fetch"
payload = { "url": "https://example.com/blog/post" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/blog/post'})
};
fetch('https://api.rankspot.ai/v1/research/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rankspot.ai/v1/research/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/blog/post'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.rankspot.ai/v1/research/fetch"
payload := strings.NewReader("{\n \"url\": \"https://example.com/blog/post\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.rankspot.ai/v1/research/fetch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/blog/post\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rankspot.ai/v1/research/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/blog/post\"\n}"
response = http.request(request)
puts response.read_body{
"markdown": "# Best screen recorders for Mac\n\nIf you are looking for..."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The page to fetch. Must be a public http(s) URL.
"https://example.com/blog/post"
Response
The page as markdown, main content only. Never empty: a page that extracts to nothing is a 503, not a successful fetch of "".
"# Best screen recorders for Mac\n\nIf you are looking for..."
