WINTR API documentation

Get to know how WINTR API works and integrate it into your app. Examples are provided in Bash, Javascript and PHP.

BONUS: check out our guides for scraping data from Amazon, Ebay, Craigslist, Aliexpress and many more on GitHub.

Getting started

Data scraping and parsing endpoint.

POST - https://api.wintr.com/fetch

Parameters:

Name
Description
Example
Options
(string) (required) url
Url to extract data from
"https://api.wintr.com/test"
* (default=null)
(string) (required) apikey
WINTR API key
"5d6bf3bd36"
* (default=null)
(array) countrycodes
Custom geo-location
["uk", "fr"]
"us"|"uk"|"de"|"nl"|"fr"|"es"|"it"|"cz"|"pl" (default=null) - WILL ONLY CHANGE YOUR HEADERS, TO CHANGE THE IP LOCATION, YOU MUST COMBINE THIS OPTION WITH "proxytype=residential"
(string) proxytype
The type of proxy you want to use
"residential"
"local"|"external"|"premium"|"residential" (default="local")) - LOCAL CONSUMES 1 API CREDIT, EXTERNAL CONSUMES 10 API CREDITS, PREMIUM CONSUMES 15 API CREDITS, RESIDENTIAL CONSUMES 25 API CREDITS
(string) session
The name of your session if you want to keep the same IP across multiple requests
"my_session_name"
* (default=null) - ONLY WORKS IF proxytype="residential"
(string) referer
Custom referer
"https://www.google.com"
* (default=null)
(string) useragent
Custom user agent
"Mozilla/5.0"
* (default=null)
(object) headers
Custom headers
{ "X-header1": "value1", "X-header2": "value2" }
* (default=null)
(string) method
Request method
"POST"
"GET"|"PATCH"|"POST"|"PUT" (default="GET")
(object) body
Request input data
{ "name1": "value1", "name2": "value2" }
* (default=null)
(string) payload
Request input payload
"{\"data_1\":[\"MyValue_1\"]}"
* (default=null)
(object) auth
HTTP authentication
{ "user": "user123", "pass": "password123" }
* (default=null)
(bool) jsrender
Javascript rendering
true
true|false (default=false) - CONSUMES 10 API CREDITS (instead of 1)
(string) renderuntil
Stops page rendering after the provided event
"domloaded"
"domloaded"|"networkloaded" (default="networkloaded") - ONLY WORKS IF jsrender=true
(bool) loadall
Load all assets (ads, analytics...)
true
true|false (default=false) - ONLY WORKS IF jsrender=true
(number|string) waitfor
Wait for time (in seconds) or CSS selector to appear
".navigation"
* (default=null) - ONLY WORKS IF jsrender=true
(object) sendform
Allows you to fill a form and send it in the browser instance
{ "fields": [ { "selector": "#myfield", "value": "myvalue" } ], "buttons": [ "#mybutton" ], "pressenter": false }
* (default=null) - ONLY WORKS IF jsrender=true
(string) executejs
Allows you to execute JS code in the browser instance (the code should be Base64 encoded)
Y29uc29sZS5sb2coJ3Rlc3QnKTs=
* (default=null) - ONLY WORKS IF jsrender=true
(array) cookies
Allows you to inject cookies on the browser instance that will scrape the page for you
[ { "name": "cookie1", "value": "value1", "domain": ".example.com" } ]
* (default=null) - ONLY WORKS IF jsrender=true
(object) outputschema
JSON output schema
* (default=null)
GENERAL INFO:
  • the maximum scrapable document size is set to 10MB
  • the timeout is set to 60 seconds for each try
  • if a request is failing for an unknown reason, it will automatically retry for a maximum of 3 times. Don't forget to set your timeout to atleast 120 seconds, to ensure everything goes smoothly
  • ​please ensure that you are respecting the concurrent requests rate of your subscribed plan, in order to avoid 429 - ERR_TOO_MANY_REQUESTS
  • on each try, the proxy IP address will be different, and if you did not set them, then some headers might be automatically set:
    • User-Agent
    • Accept
    • Accept-Encoding
    • Upgrade-Insecure-Requests
    • Sec-Fetch-User
    • Sec-Fetch-Mode
    • Accept-Language
    • Referer
STATUS CODES & ERRORS:
  • 200 - OK => Request completed successfully
  • 400 - BAD_REQUEST => Incorrect parameter(s)
  • 402 - PAYMENT_REQUIRED => Invalid API key OR plan quota exceeded
  • 444 - ERR_NO_RESPONSE => Target URL responded with XXX error code
  • 429 - ERR_TOO_MANY_REQUESTS => You are doing too many requests at once
  • 415 - ERR_UNSUPPORTED_MEDIA_TYPE => Binary files are not supported
  • 403 - ERR_TOO_BIG => Response size is bigger than 10MB
  • 408 - ERR_TIMEOUT => Timeout of 60 seconds exceeded
  • 404 - ERR_NOT_FOUND => Target URL unreachable
  • 5XX - UNKNOWN_ERROR => You won't be charged for this request

Saved requests endpoint

GET - https://api.wintr.com/savedrequest/:name

Parameters:

Name
Description
Example
Options
(string) (required) name
Name of the skeleton request you previously created in your dashboard query builder
getAmazonProductPrices
* (default=null)
(string) (required) apikey
WINTR API key
5d6bf3bd36
* (default=null)
(string) url
An URL that will override the saved request predefined target URL
https://api.wintr.com/test
* (default=null)
(urlencoded object string) headers
An urlencoded object of headers that will override the saved request predefined headers
{ "X-header1": "value1", "X-header2": "value2" }
* (default=null)
(urlencoded object string) body
An urlencoded object of form data that will override the saved request predefined body
{ "name1": "value1", "name2": "value2" }
* (default=null)

Account endpoint.

GET - https://api.wintr.com/accountdata

Parameters:

Name
Description
Example
Options
(string) (required) data
Data you want to retrieve
analytics
"info"|"analytics" (default="info")
(string) (required) apikey
WINTR API key
5d6bf3bd36
* (default=null)

Basic usage

Scrape a webpage.

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key" }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key'
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key'
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key'
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": "html..."
}

Custom geo

Scrape a webpage with custom geo-location.
EXAMPLE: countrycodes=["uk", "fr"] will rotate your browsing headers between France and UK. If you combine this option with residential proxies, it will rotate between France and United Kingdom-based IP addresses. (possible values: us, uk, de, nl, fr, es, it, cz, pl)

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "countrycodes": ["custom_country_code"] }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
countrycodes: [
'custom_country_code'
]
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'countrycodes' => array(
'custom_country_code'
)
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'countrycodes': ['custom_country_code']
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": "html..."
}

Custom referer

Scrape a webpage with a custom referer.
EXAMPLE: referer="https://www.google.com" will launch the request telling the targeted website that Google has led you to it.

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "referer": "custom_referer" }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
referer: 'custom_referer'
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'referer' => 'CUSTOM_REFERER'
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'referer': 'custom_referer'
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": "html..."
}

Custom useragent

Scrape a webpage with custom user agent.
EXAMPLE: useragent="Mozilla/5.0" will launch the request telling the targeted website that you are using Mozilla Firefox 5.

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "useragent": "custom_useragent" }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
useragent: 'custom_useragent'
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'useragent' => 'CUSTOM_USERAGENT'
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'useragent': 'custom_useragent'
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": "html..."
}

Custom headers

Scrape a webpage with custom headers.
EXAMPLE: headers={ "Authorization": "Bearer: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" } will launch the request with a Bearer authentication.

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "headers": { "X-header1": "value1", "X-header2": "value2" } }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
headers: {
'x-header1': 'value1',
'x-header2': 'value2'
}
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'headers' => array(
'x-header1' => 'value1',
'x-header2' => 'value2'
)
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'headers': {
'x-header1': 'value1',
'x-header2': 'value2'
}
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": "html..."
}

Custom method

Scrape a webpage with a custom method and send data.
EXAMPLE: method="POST" & body={ "email": "[email protected]", "password": "mypassword123" } will send some credentials to the targeted website. (possible values: GET, PATCH, POST, PUT)

IMPORTANT NOTE: you can use payload="{\"email\": \"[email protected]\", \"password\": \"mypassword123\"}" to send the data as an escaped string instead of a JSON object!

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "method": "post", "body": { "name1": "value1", "name2": "value2" } }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
method: 'POST',
body: {
'NAME1': 'VALUE1',
'NAME2': 'VALUE2'
}
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'method' => 'POST',
'body' => array(
'name1' => 'value1',
'name2' => 'value2'
)
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'method': 'post',
'body': {
'name1': 'value1',
'name2': 'value2'
}
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": "html..."
}

HTTP authentication

Scrape a webpage protected by an HTTP authentication.
EXAMPLE: auth={ "user": "USERNAME", "pass": "PASSWORD" } will perform an HTTP authentication on the targeted website.

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "auth": { "user": "username", "pass": "password" } }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
auth: {
'user': 'username',
'pass': 'password'
}
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'auth' => array(
'user' => 'username',
'pass' => 'password'
)
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'auth': {
'user': 'username',
'pass': 'password'
}
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": "html..."
}

JS rendering

Scrape a Javascript rendered webpage.
EXAMPLE: jsrender=true will load all the XHR requests and render the Javascript of the targeted website using a headless browser. (possible values: true, false)

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "jsrender": true }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
jsrender: true
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'jsrender' => true
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'jsrender': true
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 10
},
"content": "html..."
}

JS rendering & render DOM only

Scrape a Javascript rendered webpage and load the DOM only.


IMPORTANT NOTE:
  • by default, when using Javascript rendering scraping, the request data is returned when all document XHR network requests are done. Use the renderuntil (string) parameter to set when should the program stop rendering the page, you can return the data earlier by setting it to stop once the dom has been rendered

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "jsrender": true, "renderuntil": "domloaded" }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
jsrender: true,
renderuntil: 'domloaded'
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'jsrender' => true,
'renderuntil' => 'domloaded'
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'jsrender': true,
'renderuntil': 'domloaded'
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 10
},
"content": "html..."
}

JS & external assets rendering

Scrape a Javascript rendered webpage including external assets.


IMPORTANT NOTE:
  • by default, when using Javascript rendering scraping, ads, videos, analytics scripts and common assets are not loaded. Use the loadall (boolean) parameter to fetch everything (requests might be slowed down)

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "jsrender": true, "loadall": true }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
jsrender: true,
loadall: true
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'jsrender' => true,
'loadall' => true
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'jsrender': true,
'loadall': true
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 10
},
"content": "html..."
}

JS rendering & wait 5 seconds

Scrape a Javascript rendered webpage and wait 5 seconds before returning the data (useful for element loaded with a delay).


IMPORTANT NOTE:
  • by default, when using Javascript rendering scraping, the program waits for the page to be loaded to return the data. Use the waitfor (number|string) parameter with a (number) in seconds to wait for the desired amount of time or a (string) CSS selector to wait for the desired element to appear (requests might be slowed down). This feature will cause the request to not auto-retry in case of failure and has a timeout of 30 seconds

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "jsrender": true, "waitfor": 5 }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
jsrender: true,
waitfor: 5
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'jsrender' => true,
'waitfor' => 5
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'jsrender': true,
'waitfor': 5
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 10
},
"content": "html..."
}

JS rendering & wait for element loading

Scrape a Javascript rendered webpage and wait for a predefined element to be rendered before returning the data (useful for element loaded with a delay).


IMPORTANT NOTE:
  • by default, when using Javascript rendering scraping, the program waits for the page to be loaded to return the data. Use the waitfor (number|string) parameter with a (number) in seconds to wait for the desired amount of time or a (string) CSS selector to wait for the desired element to appear (requests might be slowed down). This feature will cause the request to not auto-retry in case of failure and has a timeout of 30 seconds

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "jsrender": true, "waitfor": "css_selector" }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
jsrender: true,
waitfor: 'css_selector'
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'jsrender' => true,
'waitfor' => 'css_selector'
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'jsrender': true,
'waitfor': 'css_selector'
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 10
},
"content": "html..."
}

JS rendering & send form

Scrape a Javascript rendered webpage, fill form fields and click page buttons.


IMPORTANT NOTE:
  • the sendform (object) parameter make the browser to will wait for all the fields and buttons to be visible on the page before filling and clicking
  • To take advantage of this feature, combine it with the waitfor (number|string) parameter to wait for a CSS selector that is only rendered after the form has been sent
  • If pressenter is true, the browser will press the Enter key once the input fields are filled
  • The sendform (object) parameter has a timeout of 15 seconds

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "jsrender": true, "sendform": { "fields": [ { "selector": "#myfield", "value": "myvalue" } ], "buttons": [ "#mybutton" ], "pressenter": false } }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
jsrender: true,
sendform: {
fields: [ {
selector: '#myfield',
value: 'myvalue'
} ],
buttons: [ '#mybutton' ],
pressenter: false
}
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'jsrender' => true,
'sendform' => array(
'fields' => array(
array(
'selector' => '#myfield',
'value' => 'myvalue'
)
),
'buttons' => array( '#mybutton' ),
'pressenter' => false
)
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'jsrender': True,
'sendform': {
'fields': [ {
'selector': '#myfield',
'value': 'myvalue'
} ],
'buttons': [ '#mybutton' ],
'pressenter': false
}
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 10
},
"content": "html..."
}

JS rendering & execute code

Scrape a Javascript rendered webpage and execute a Javascript code snippet (useful to scroll page, click buttons, send forms, etc).


IMPORTANT NOTE:
  • the executejs (string) parameter needs to be a Javascript code snippet encoded to Base64. The code will be executed after page load but before the waitfor (number|string) parameter, so, you can add an element to the page HTML and wait for its selector to appear to be sure that your snippet is completely executed. In the example, "d2luzg93lnnjcm9sbfrvkdasigrvy3vtzw50lmjvzhkuc2nyb2xssgvpz2h0kts=" equals "window.scrollTo(0, document.body.scrollHeight);" in Base64.

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "jsrender": true, "executejs": "d2luZG93LnNjcm9sbFRvKDAsIGRvY3VtZW50LmJvZHkuc2Nyb2xsSGVpZ2h0KTs=" }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
jsrender: true,
executejs: 'd2luZG93LnNjcm9sbFRvKDAsIGRvY3VtZW50LmJvZHkuc2Nyb2xsSGVpZ2h0KTs='
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'jsrender' => true,
'executejs' => 'd2luZG93LnNjcm9sbFRvKDAsIGRvY3VtZW50LmJvZHkuc2Nyb2xsSGVpZ2h0KTs='
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'jsrender': true,
'executejs': 'd2luZG93LnNjcm9sbFRvKDAsIGRvY3VtZW50LmJvZHkuc2Nyb2xsSGVpZ2h0KTs='
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 10
},
"content": "html..."
}

JS rendering with custom cookies

Scrape a webpage and add custom cookies (requires Javascript rendering).


IMPORTANT NOTE:
  • you can add cookies to the browser that will fetch the page you want to scrape. Use the cookies (array) parameter with some (object) to inject cookies before the request, the possible cookie (object) keys are:
    • "name": the cookie name (string)
    • "value": the cookie value (string)
    • "domain": the cookie domain (string)
    • "path": the cookie path (string)
    • "expires": the cookie expiration time (number: unix time in seconds)
    • "size": the cookie size (number: name + value character count)
    • "httpOnly": security option (bool)
    • "secure": security option (bool)
    • "session": is it a session cookie (bool)
    • "sameSite": security option (bool)

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "jsrender": true, "cookies": [ { "name": "cookie1", "value": "value1", "domain": ".example.com" } ] }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
jsrender: true,
cookies: [ {
'name': 'cookie1',
'value': 'value1',
'domain': '.example.com'
} ]
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'jsrender' => 'true',
'cookies' => array(
array(
'name' => 'cookie1',
'value' => 'value1',
'domain' => '.example.com'
)
)
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'jsrender': true,
'cookies': [ {
'name': 'cookie1',
'value': 'value1',
'domain': '.example.com'
} ]
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": "html..."
}

Residential proxy scraping

Scrape a webpage using a residential proxy IP address.


IMPORTANT NOTE:
  • by default, the program is using a datacenter (local) proxy IP address to retrieve the data. For websites that are hard to scrape, you can use external, premium and residential proxies

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "proxytype": "residential" }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
proxytype: 'residential'
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'proxytype' => 'residential'
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'proxytype': 'residential'
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 25
},
"content": "html..."
}

Session across multiple requests

Scrape a webpage using a session to keep the same IP address across multiple requests (expires after 120 seconds).


IMPORTANT NOTE:
  • if you want too keep the same IP address across multiple requests, you can use the session (string) parameter to proceed. Your session has a duration of 120 seconds. This feature only works with residential proxy requests.
  • if you want to define the geolocation of your session, you have to set the countrycodes (array) parameter with one and only country code at the creation of the session, if you created the session before setting the countrycodes (array) parameter, you need to create a session with a different name to proceed or wait the current one to expire after 120 seconds.

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "proxytype": "residential", "session": "my_session_name" }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
proxytype: 'residential',
session: 'my_session_name'
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'proxytype' => 'residential',
'session' => 'my_session_name'
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'proxytype': 'residential',
'session': 'my_session_name'
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 25
},
"content": "html..."
}

Execute saved request

Execute a skeleton request that has been previously created in your dashboard query builder

curl 'https://api.wintr.com/savedrequest/SAVED_REQUEST_NAME?apikey=wintr_api_key'

const axios = require('axios')

axios('https://api.wintr.com/savedrequest/SAVED_REQUEST_NAME?apikey=wintr_api_key')
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/savedrequest/SAVED_REQUEST_NAME?apikey=wintr_api_key');

curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.get('https://api.wintr.com/savedrequest/saved_request_name?apikey=wintr_api_key')
content = json.loads(req.content)

print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": "html..."
}

Execute & override saved request

Execute a skeleton request that has been previously created in your dashboard query builder and override the target url and the request headers

apt install -y gridsite-clients

curl 'https://api.wintr.com/savedrequest/SAVED_REQUEST_NAME?apikey=wintr_api_key&url=override_url&headers='$(urlencode "{ \"X-HEADER1\": \"VALUE1\", \"X-HEADER2\": \"VALUE2\" }")

const axios = require('axios')
const CUSTOM_HEADERS = encodeURIComponent(JSON.stringify({
"X-HEADER1": "VALUE1",
"X-HEADER2": "VALUE2"
}))


axios('https://api.wintr.com/savedrequest/SAVED_REQUEST_NAME?apikey=wintr_api_key&url=override_url&headers=' + CUSTOM_HEADERS)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$CUSTOM_HEADERS = urlencode(json_encode(array(
"X-HEADER1" => "VALUE1",
"X-HEADER2" => "VALUE2"
)));
$request = curl_init('https://api.wintr.com/savedrequest/SAVED_REQUEST_NAME?apikey=wintr_api_key&url=override_url&headers=' . $CUSTOM_HEADERS);

curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json
import urllib

custom_headers = urllib.quote(json.dumps({
'x-header1': 'value1',
'x-header2': 'value2'
}))

req = requests.get('https://api.wintr.com/savedrequest/saved_request_name?apikey=wintr_api_key&url=override_url&headers=' + custom_headers)

content = json.loads(req.content)

print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": "html..."
}

Output schema

Scrape a webpage and parse its content.


IMPORTANT NOTE:
  • if you want to parse the HTML content, the outputschema (object) should respect certain conditions:
    • the outputschema (object) child object(s) can only contain these keys:
      • group (string): the main CSS selector
      • data (object): the data structure
    • the data (object) child object(s) must contain these keys:
      • selector (string): the child CSS selector
      • attr (string): the HTML attribute or "*html*" or "*text*"
      and optionally these keys:
      • modifier (array): a list of modifications to apply to the data
      • replacer (array): a search-and-replace array of objects
    • if present, the modifier (array) accepted values are these (strings):
      • "touppercase": turn data to uppercase strings
      • "tolowercase": turn data to lowercase strings
      • "tonumber": turn data to primitive numbers
      • "totrimmed": turn data to trimmed strings
    • if present, the replacer (array) accepted values are (objects) which must contain 2 (strings):
      • search (string)
      • replace (string)
    • it will search and replace in the data
PARSING INFO:
  • The parsing process is made in the order that you set the modifier (array) and replacer (array) elements in your outputschema (object)
  • each modification or replacement will be done in order of the provided (arrays)
ADDITIONAL NOTE:
  • We’ve created awesome output schemas for Amazon, Ebay, Craigslist, Aliexpress and many more on GitHub

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "outputschema": { "links": { "group": "a", "data": { "link_anchor": { "selector": "a", "attr": "*text*" }, "link_target": { "selector": "a", "attr": "href" } } } } }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
outputschema: {
links: {
group: 'a',
data: {
link_anchor: {
selector: 'a',
attr: '*text*'
},
link_target: {
selector: 'a',
attr: 'href'
}
}
}
}
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'outputschema' => array(
'links' => array(
'group' => 'a',
'data' => array(
'link_anchor' => array(
'selector' => 'a',
'attr' => '*text*'
),
'link_target' => array(
'selector' => 'a',
'attr' => 'href'
)
)
)
)
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'outputschema': {
'links': {
'group': 'a',
'data': {
'link_anchor': {
'selector': 'a',
'attr': '*text*'
},
'link_target': {
'selector': 'a',
'attr': 'href'
}
}
}
}
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": {
"links": {
[
{
"link_anchor": "...",
"link_target": "..."
},
{
"link_anchor": "...",
"link_target": "..."
},
{
"link_anchor": "...",
"link_target": "..."
}
]
}
}
}

Filtered output schema

Scrape a webpage, parse and filter its content.

curl -X POST 'https://api.wintr.com/fetch' \
-H 'Content-Type: application/json' \
-d '{ "url": "target_url", "apikey": "wintr_api_key", "outputschema": { "links": { "group": "a", "data": { "link_anchor_without_linebreak_AND_trimmed_AND_to_uppercase": { "selector": "a", "attr": "*text*", "replacer": [ { "search": "\n", "replace": "" } ], "modifier": [ "totrimmed", "touppercase" ] }, "link_target": { "selector": "a", "attr": "href" } } } } }'

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'target_url',
apikey: 'wintr_api_key',
outputschema: {
links: {
group: 'a',
data: {
link_anchor_without_linebreak_AND_trimmed_AND_to_uppercase: {
selector: 'a',
attr: '*text*',
replacer: [
{
search: '\n',
replace: ''
}
],
modifier: [
'totrimmed',
'touppercase'
]
},
link_target: {
selector: 'a',
attr: 'href'
}
}
}
}
},
url: 'https://api.wintr.com/fetch'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/fetch');
$body = json_encode(array(
'url' => 'target_url',
'apikey' => 'wintr_api_key',
'outputschema' => array(
'links' => array(
'group' => 'a',
'data' => array(
'link_anchor_without_linebreak_AND_trimmed_AND_to_uppercase' => array(
'selector' => 'a',
'attr' => '*text*',
'replacer' => array(
array(
'search' => '\n',
'replace' => ''
)
),
'modifier' => array(
'totrimmed',
'touppercase'
)
),
'link_target' => array(
'selector' => 'a',
'attr' => 'href'
)
)
)
)
));

curl_setopt($request, CURLOPT_POSTFIELDS, $body);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.post('https://api.wintr.com/fetch', data = json.dumps({
'url': 'target_url',
'apikey': 'wintr_api_key',
'outputschema': {
'links': {
'group': 'a',
'data': {
'link_anchor_without_linebreak_and_trimmed_and_to_uppercase': {
'selector': 'a',
'attr': '*text*',
'replacer': [ {
'search': '\n',
'replace': ''
} ],
'modifier': [
'totrimmed',
'touppercase'
]
},
'link_target': {
'selector': 'a',
'attr': 'href'
}
}
}
}
}), headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
})

content = json.loads(req.content)
print(content)

Result:

{
"info": {
"status": 200,
"method": "GET",
"request_headers": { ... },
"response_headers": { ... },
"charged_apicredits": 1
},
"content": {
"links": {
[
{
"link_anchor_without_linebreak_and_trimmed_and_to_uppercase": "...",
"link_target": "..."
},
{
"link_anchor_without_linebreak_and_trimmed_and_to_uppercase": "...",
"link_target": "..."
},
{
"link_anchor_without_linebreak_and_trimmed_and_to_uppercase": "...",
"link_target": "..."
}
]
}
}
}

Account balance

Get account balance.

curl 'https://api.wintr.com/accountdata?data=info&apikey=wintr_api_key'

const axios = require('axios')

axios('https://api.wintr.com/accountdata/?data=info&apikey=wintr_api_key')
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/accountdata?data=info&apikey=wintr_api_key');

curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.get('https://api.wintr.com/accountdata/?data=info&apikey=wintr_api_key')
content = json.loads(req.content)

print(content)

Result:

{
"email": "account_email",
"apicredits": account_api_credit_balance
}

Account analytics

Get account analytics (last 7 days).

curl 'https://api.wintr.com/accountdata?data=analytics&apikey=wintr_api_key'

const axios = require('axios')

axios('https://api.wintr.com/accountdata/?data=analytics&apikey=wintr_api_key')
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

$request = curl_init('https://api.wintr.com/accountdata?data=analytics&apikey=wintr_api_key');

curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

var_dump(curl_exec($request));
curl_close($request);

import requests
import json

req = requests.get('https://api.wintr.com/accountdata?data=analytics&apikey=wintr_api_key')
content = json.loads(req.content)

print(content)

Result:

{
"email": "account_email",
"analytics": [ ... ]
}