Introduction
All the requests must be pointed to the following base URL:
This documentation aims to provide all the information you need to work with MrScraper's API.
Feel free to contact us if you have any questions or you are missing any endpoint.
Authenticating requests
Authenticate requests to this API's endpoints by sending an Authorization
header with the value "Bearer {YOUR_API_TOKEN}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by visiting the API Tokens section inside your profile page.
Account
Get an account information summary
requires authentication
This endpoint allows you to get basic information from your account such as token usage and other stats.
Example request:
curl --request GET \
--get "https://mrscraper.com/api/account" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://mrscraper.com/api/account"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://mrscraper.com/api/account',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://mrscraper.com/api/account'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": {
"subscription_plan": "Ultimate",
"token_usage": 137,
"token_limit": 30000,
"monthly_scrapes": 17,
"average_tokens_scrape": 8.06
}
}
Received response:
Request failed with error:
Scrapers
List all scrapers
requires authentication
This endpoint allows you to get a list of all your scrapers.
Example request:
curl --request GET \
--get "https://mrscraper.com/api/scrapers" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://mrscraper.com/api/scrapers"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://mrscraper.com/api/scrapers',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://mrscraper.com/api/scrapers'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": [
{
"id": 88683,
"name": "My scraper 1",
"url": "https://example.com/scrape-url",
"scheduled": false,
"schedule": null,
"schedule_explanation": null,
"created_at": "2022-11-20T11:54:52.000000Z",
"updated_at": "2022-11-20T11:54:52.000000Z"
},
{
"id": 88684,
"name": "My scraper 2",
"url": "https://example.com/scrape-url-alt",
"scheduled": true,
"schedule": "15 1 * * *",
"schedule_explanation": "At 01:15 AM",
"created_at": "2022-11-20T11:54:52.000000Z",
"updated_at": "2022-11-20T11:54:52.000000Z"
},
]
}
Received response:
Request failed with error:
Get a scraper
requires authentication
This endpoint allows you to get a single scraper's information.
Example request:
curl --request GET \
--get "https://mrscraper.com/api/scrapers/88683" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://mrscraper.com/api/scrapers/88683"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://mrscraper.com/api/scrapers/88683',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://mrscraper.com/api/scrapers/88683'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": {
"id": 88683,
"name": "My scraper 1",
"url": "https://example.com/scrape-url",
"scheduled": true,
"schedule": "15 1 * * *",
"schedule_explanation": "At 01:15 AM",
"created_at": "2022-11-20T11:54:52.000000Z",
"updated_at": "2022-11-20T11:54:52.000000Z"
}
}
Received response:
Request failed with error:
Run a scraper
requires authentication
This endpoint allows you to tell a scraper to start scraping.
Example request:
curl --request POST \
"https://mrscraper.com/api/scrapers/88683/run" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"urls\": [
\"https:\\/\\/example.com\\/page-1\",
\"https:\\/\\/example.com\\/page-2\"
]
}"
const url = new URL(
"https://mrscraper.com/api/scrapers/88683/run"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"urls": [
"https:\/\/example.com\/page-1",
"https:\/\/example.com\/page-2"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://mrscraper.com/api/scrapers/88683/run',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'urls' => [
'https://example.com/page-1',
'https://example.com/page-2',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://mrscraper.com/api/scrapers/88683/run'
payload = {
"urls": [
"https:\/\/example.com\/page-1",
"https:\/\/example.com\/page-2"
]
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"data": [
{
"id": 1,
"scraper_id": 88683,
"scraper_name": "My scraper 1",
"scraped_url": "https://example.com/page-1",
"status": "queued",
"content": null,
"created_at": "2022-11-20T11:54:52.000000Z",
"updated_at": "2022-11-20T11:54:52.000000Z"
},
{
"id": 2,
"scraper_id": 88683,
"scraper_name": "My scraper 1",
"scraped_url": "https://example.com/page-2",
"status": "queued",
"content": null,
"created_at": "2022-10-20T11:54:52.000000Z",
"updated_at": "2022-10-20T11:54:52.000000Z"
}
]
}
Received response:
Request failed with error:
Results
Get a scraper's latest result
requires authentication
This endpoint returns the information about the latest result for a scraper.
You can use the optional status
body parameter to filter the result for a particular scraping status.
Example request:
curl --request GET \
--get "https://mrscraper.com/api/scrapers/88683/results/latest" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"status\": \"succeeded\"
}"
const url = new URL(
"https://mrscraper.com/api/scrapers/88683/results/latest"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"status": "succeeded"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://mrscraper.com/api/scrapers/88683/results/latest',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'status' => 'succeeded',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://mrscraper.com/api/scrapers/88683/results/latest'
payload = {
"status": "succeeded"
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"data": {
"id": 1,
"scraper_id": 88683,
"scraper_name": "My scraper 1",
"scraped_url": "https://example.com/scrape-url",
"status": "succeeded",
"content": "<your-extracted-data>",
"created_at": "2022-11-20T11:54:52.000000Z",
"updated_at": "2022-11-20T11:54:52.000000Z"
}
}
Example response (200):
{
"data": null
}
Received response:
Request failed with error:
List all results
requires authentication
This endpoint allows you to get a list of all your scraping results.
Example request:
curl --request GET \
--get "https://mrscraper.com/api/results" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://mrscraper.com/api/results"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://mrscraper.com/api/results',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://mrscraper.com/api/results'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": [
{
"id": 2,
"scraper_id": 88683,
"scraper_name": "My scraper 1",
"scraped_url": "https://example.com/scrape-url",
"status": "succeeded",
"content": "<your-extracted-data>",
"created_at": "2022-11-20T11:54:52.000000Z",
"updated_at": "2022-11-20T11:54:52.000000Z"
},
{
"id": 1,
"scraper_id": 88683,
"scraper_name": "My scraper 1",
"scraped_url": "https://example.com/scrape-url",
"status": "succeeded",
"content": "<your-extracted-data>",
"created_at": "2022-10-20T11:54:52.000000Z",
"updated_at": "2022-10-20T11:54:52.000000Z"
}
]
}
Received response:
Request failed with error:
Get a result
requires authentication
This endpoint allows you to get a scraping result.
Example request:
curl --request GET \
--get "https://mrscraper.com/api/results/88683" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://mrscraper.com/api/results/88683"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://mrscraper.com/api/results/88683',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://mrscraper.com/api/results/88683'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"id": 1,
"scraper_id": 88683,
"scraper_name": "My scraper 1",
"scraped_url": "https://example.com/scrape-url",
"status": "succeeded",
"content": "<your-extracted-data>",
"created_at": "2022-11-20T11:54:52.000000Z",
"updated_at": "2022-11-20T11:54:52.000000Z"
},
Received response:
Request failed with error:
Delete a result
requires authentication
This endpoint allows you to delete a scraping result.
Example request:
curl --request DELETE \
"https://mrscraper.com/api/results/88683" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://mrscraper.com/api/results/88683"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://mrscraper.com/api/results/88683',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://mrscraper.com/api/results/88683'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (200):
{}
Received response:
Request failed with error: