Send Your First Request
Send your first WebPage API request with a Bearer token, configure the target URL and rendering options, and retrieve webpage content in HTML format.
Send your first request using Thordata's WebPage. Before you start, you will need an API Token.
You can get a free trial on the [Pricing] page.
Then, copy your credentials under [API Playground] > "Token".
Code example: After obtaining your API credentials, use the following code to send your first request:
curl -X POST https://webunlocker.thordata.com/request \
-H "Authorization: Bearer token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "url=https://www.google.com" \
-d "type=html" \
-d "js_render=True" \
-d "header=False"import http.client
from urllib.parse import urlencode
conn = http.client.HTTPSConnection("universalapi.thordata.com")
payload = {
"url": "https://www.google.com",
"type": "html",
"js_render": "True",
"header": "False"
}
form_data = urlencode(payload)
headers = {
'Authorization': "Bearer token",
'content-type': "application/x-www-form-urlencoded"
}
conn.request("POST", "/request", form_data, headers)
res = conn.getresponse()
data = res.read()
print(f"Status: {res.status} {res.reason}")
print(data.decode("utf-8"))After sending the request, it will return output results in HTML format:
<!DOCTYPE html>
<html itemscope="" itemtype="http://schema.org/WebPage" lang="en">
<head>
<meta charset="UTF-8">
<meta content="origin" name="referrer">
<link href="//www.gstatic.com/images/branding/searchlogo/ico/favicon.ico" rel="icon">
<meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image">
<style>
@font-face {
font-family: 'Google Sans';
font-style: normal;
font-weight: 400 700;
font-display: optional;
src: url(//fonts.gstatic.com/s/googlesans/v29/4UaGrENHsxJlGDuGo1OIlL3Owp4.woff2) format('woff2');
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: optional;
src: url(//fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2');
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-display: optional;
src: url(//fonts.gstatic.com/s/roboto/v18/KFOlCnqEu92Fr1MmWUlfBBc4.woff2) format('woff2');
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
</style>
<script nonce="">
(function(){
var w=["Google Sans",[400,500,700],"Roboto",[400,700]];
(function(){
for(var a=0;a<w.length;a+=2)
for(var d=w[a],e=w[a+1],b=0,c=void 0;c=e[b];++b)
document.fonts.load(c+" 10pt "+d).catch(function(){})
...If you need further assistance, contact us at support@thordata.com.
Last updated