/webparser/parse
curl --request POST \
--url https://api.anysite.io/api/webparser/parse \
--header 'Content-Type: application/json' \
--header 'access-token: <api-key>' \
--data '
{
"url": "<string>",
"timeout": 300,
"include_tags": [
"<string>"
],
"exclude_tags": [
"<string>"
],
"only_main_content": false,
"remove_comments": true,
"resolve_srcset": true,
"return_full_html": false,
"min_text_block": 200,
"remove_base64_images": true,
"strip_all_tags": false,
"extract_contacts": false,
"same_origin_links": false,
"social_links_only": false,
"extract_minimal": false
}
'import requests
url = "https://api.anysite.io/api/webparser/parse"
payload = {
"url": "<string>",
"timeout": 300,
"include_tags": ["<string>"],
"exclude_tags": ["<string>"],
"only_main_content": False,
"remove_comments": True,
"resolve_srcset": True,
"return_full_html": False,
"min_text_block": 200,
"remove_base64_images": True,
"strip_all_tags": False,
"extract_contacts": False,
"same_origin_links": False,
"social_links_only": False,
"extract_minimal": False
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
timeout: 300,
include_tags: ['<string>'],
exclude_tags: ['<string>'],
only_main_content: false,
remove_comments: true,
resolve_srcset: true,
return_full_html: false,
min_text_block: 200,
remove_base64_images: true,
strip_all_tags: false,
extract_contacts: false,
same_origin_links: false,
social_links_only: false,
extract_minimal: false
})
};
fetch('https://api.anysite.io/api/webparser/parse', 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.anysite.io/api/webparser/parse",
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' => '<string>',
'timeout' => 300,
'include_tags' => [
'<string>'
],
'exclude_tags' => [
'<string>'
],
'only_main_content' => false,
'remove_comments' => true,
'resolve_srcset' => true,
'return_full_html' => false,
'min_text_block' => 200,
'remove_base64_images' => true,
'strip_all_tags' => false,
'extract_contacts' => false,
'same_origin_links' => false,
'social_links_only' => false,
'extract_minimal' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);
$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.anysite.io/api/webparser/parse"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"timeout\": 300,\n \"include_tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"only_main_content\": false,\n \"remove_comments\": true,\n \"resolve_srcset\": true,\n \"return_full_html\": false,\n \"min_text_block\": 200,\n \"remove_base64_images\": true,\n \"strip_all_tags\": false,\n \"extract_contacts\": false,\n \"same_origin_links\": false,\n \"social_links_only\": false,\n \"extract_minimal\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("access-token", "<api-key>")
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.anysite.io/api/webparser/parse")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"timeout\": 300,\n \"include_tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"only_main_content\": false,\n \"remove_comments\": true,\n \"resolve_srcset\": true,\n \"return_full_html\": false,\n \"min_text_block\": 200,\n \"remove_base64_images\": true,\n \"strip_all_tags\": false,\n \"extract_contacts\": false,\n \"same_origin_links\": false,\n \"social_links_only\": false,\n \"extract_minimal\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anysite.io/api/webparser/parse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"timeout\": 300,\n \"include_tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"only_main_content\": false,\n \"remove_comments\": true,\n \"resolve_srcset\": true,\n \"return_full_html\": false,\n \"min_text_block\": 200,\n \"remove_base64_images\": true,\n \"strip_all_tags\": false,\n \"extract_contacts\": false,\n \"same_origin_links\": false,\n \"social_links_only\": false,\n \"extract_minimal\": false\n}"
response = http.request(request)
puts response.read_body[
{
"cleaned_html": "<string>",
"url": "<string>",
"@type": "WebParserResult",
"meta_description": "<string>",
"metadata": {},
"links": [
"<string>"
],
"emails": [
"<string>"
],
"phones": [
"<string>"
]
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Webparser
/webparser/parse
Parse and clean HTML from web page
Price: 1 credit
⚠️ Common errors: 412: Failed to fetch URL or page not found.
POST
/
api
/
webparser
/
parse
/webparser/parse
curl --request POST \
--url https://api.anysite.io/api/webparser/parse \
--header 'Content-Type: application/json' \
--header 'access-token: <api-key>' \
--data '
{
"url": "<string>",
"timeout": 300,
"include_tags": [
"<string>"
],
"exclude_tags": [
"<string>"
],
"only_main_content": false,
"remove_comments": true,
"resolve_srcset": true,
"return_full_html": false,
"min_text_block": 200,
"remove_base64_images": true,
"strip_all_tags": false,
"extract_contacts": false,
"same_origin_links": false,
"social_links_only": false,
"extract_minimal": false
}
'import requests
url = "https://api.anysite.io/api/webparser/parse"
payload = {
"url": "<string>",
"timeout": 300,
"include_tags": ["<string>"],
"exclude_tags": ["<string>"],
"only_main_content": False,
"remove_comments": True,
"resolve_srcset": True,
"return_full_html": False,
"min_text_block": 200,
"remove_base64_images": True,
"strip_all_tags": False,
"extract_contacts": False,
"same_origin_links": False,
"social_links_only": False,
"extract_minimal": False
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
timeout: 300,
include_tags: ['<string>'],
exclude_tags: ['<string>'],
only_main_content: false,
remove_comments: true,
resolve_srcset: true,
return_full_html: false,
min_text_block: 200,
remove_base64_images: true,
strip_all_tags: false,
extract_contacts: false,
same_origin_links: false,
social_links_only: false,
extract_minimal: false
})
};
fetch('https://api.anysite.io/api/webparser/parse', 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.anysite.io/api/webparser/parse",
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' => '<string>',
'timeout' => 300,
'include_tags' => [
'<string>'
],
'exclude_tags' => [
'<string>'
],
'only_main_content' => false,
'remove_comments' => true,
'resolve_srcset' => true,
'return_full_html' => false,
'min_text_block' => 200,
'remove_base64_images' => true,
'strip_all_tags' => false,
'extract_contacts' => false,
'same_origin_links' => false,
'social_links_only' => false,
'extract_minimal' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);
$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.anysite.io/api/webparser/parse"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"timeout\": 300,\n \"include_tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"only_main_content\": false,\n \"remove_comments\": true,\n \"resolve_srcset\": true,\n \"return_full_html\": false,\n \"min_text_block\": 200,\n \"remove_base64_images\": true,\n \"strip_all_tags\": false,\n \"extract_contacts\": false,\n \"same_origin_links\": false,\n \"social_links_only\": false,\n \"extract_minimal\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("access-token", "<api-key>")
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.anysite.io/api/webparser/parse")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"timeout\": 300,\n \"include_tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"only_main_content\": false,\n \"remove_comments\": true,\n \"resolve_srcset\": true,\n \"return_full_html\": false,\n \"min_text_block\": 200,\n \"remove_base64_images\": true,\n \"strip_all_tags\": false,\n \"extract_contacts\": false,\n \"same_origin_links\": false,\n \"social_links_only\": false,\n \"extract_minimal\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anysite.io/api/webparser/parse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"timeout\": 300,\n \"include_tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"only_main_content\": false,\n \"remove_comments\": true,\n \"resolve_srcset\": true,\n \"return_full_html\": false,\n \"min_text_block\": 200,\n \"remove_base64_images\": true,\n \"strip_all_tags\": false,\n \"extract_contacts\": false,\n \"same_origin_links\": false,\n \"social_links_only\": false,\n \"extract_minimal\": false\n}"
response = http.request(request)
puts response.read_body[
{
"cleaned_html": "<string>",
"url": "<string>",
"@type": "WebParserResult",
"meta_description": "<string>",
"metadata": {},
"links": [
"<string>"
],
"emails": [
"<string>"
],
"phones": [
"<string>"
]
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API token from the dashboard
Headers
Body
application/json
Required string length:
10 - 2083Required range:
20 <= x <= 1500Required range:
x >= 0⌘I