Skip to main content

Web Scraper API documentation

Get to know how Web Scraper API works and integrate it into your app. Examples are provided in Curl, Javascript and Python.

Data Scraping and API Endpoint Integration

https://scrape.infatica.io

Sync API

info

Sync API allows to receive immediate result using our Residential Proxy

Query Parameters

NameDescriptionExampleOptions
url (string, required)Destination url to retrieve (url-encoded){"url":"google.com"}default=null
api_key (string, required)Web Scraper API key{"api_key":"0de32912321"}default=null
country_code (str, optional)Proxy country code (geolocation){"country_code":"fr"}default=null, options - us, gb, de, fr, cn, jp. View all codes
render_js (bool, optional)Render JS on page{"render_js":"true"}default=false
return_json (bool, optional)Return HTML if flagged "false"{"return_json": "false"}default=true
headers (JSON, optional)Custom headers{ "headers": {"user-agent": "Example user agent", "accept": "text/html,*/*"} }default our headers
language (str, optional)Language{"language":"en-US"}default=en-US, options - en-US, en-CA, es-ES, fr-CA. View all codes
selector (str, optional)CSS Selector{"selector":".className"}, {"selector":"#idName"}default=null, is only used with render_js. Timeout <= 60 sec. CSS Selector Reference

Returns

Status codeDescriptionExample
200 (Success)Request successful. Returns JSON with headers and html fields{"headers":{}, 'html':""}
401 (Unauthorized)API key is missing or wrong{'error':'API key is missing or wrong'}
422 (Unprocessable Entity)Error in query parameters{'error':'Wrong query'}
504 (Timeout)Site returned timeout after 3 attempts to reach it{'error':'Timeout'}
API key:

'api_key': 'API_KEY', where API_KEY is your Infatica API key

Country codes

If you want to define the geolocation for your request, you may set the country_code (string) parameter with one country code at the creation of the request.

Example: 'us', 'gb', 'fr', 'de', 'jp', 'cn', 'ru'

Supported country codes can be found in the collapsible table below:

All country codes (click here to expand)
CodeCountry nameCodeCountry nameCodeCountry name
adAndorraglGreenlandnoNorway
aeUnited Arab EmiratesgmGambianpNepal
afAfghanistangnGuineanrNauru
agAntigua and BarbudagpGuadeloupenuNiue
aiAnguillagqEquatorial GuineanzNew Zealand
alAlbaniagrGreeceomOman
amArmeniagsSouth Georgia and the South Sandwich IslandspaPanama
aoAngolagtGuatemalapePeru
aqAntarcticaguGuampfFrench Polynesia
arArgentinagwGuinea-BissaupgPapua New Guinea
asAmerican SamoagyGuyanaphPhilippines
atAustriahkHong KongpkPakistan
auAustraliahmHeard Island and McDonald IslandsplPoland
awArubahnHonduraspmSaint Pierre and Miquelon
axÅland IslandshrCroatiapnPitcairn
azAzerbaijanhtHaitiprPuerto Rico
baBosnia and HerzegovinahuHungarypsPalestine, State of
bbBarbadosidIndonesiaptPortugal
bdBangladeshieIrelandpwPalau
beBelgiumilIsraelpyParaguay
bfBurkina FasoimIsle of ManqaQatar
bgBulgariainIndiareRéunion
bhBahrainioBritish Indian Ocean TerritoryroRomania
biBurundiiqIraqrsSerbia
bjBeninirIran (Islamic Republic of)ruRussian Federation
blSaint BarthélemyisIcelandrwRwanda
bmBermudaitItalysaSaudi Arabia
bnBrunei DarussalamjeJerseysbSolomon Islands
boBolivia (Plurinational State of)jmJamaicascSeychelles
bqBonaire, Sint Eustatius and SabajoJordansdSudan
brBraziljpJapanseSweden
bsBahamaskeKenyasgSingapore
btBhutankgKyrgyzstanshSaint Helena, Ascension and Tristan da Cunha
bvBouvet IslandkhCambodiasiSlovenia
bwBotswanakiKiribatisjSvalbard and Jan Mayen
byBelaruskmComorosskSlovakia
bzBelizeknSaint Kitts and NevisslSierra Leone
caCanadakpKorea (Democratic People's Republic of)smSan Marino
ccCocos (Keeling) IslandskrKorea, Republic ofsnSenegal
cdCongo, Democratic Republic of thekwKuwaitsoSomalia
cfCentral African RepublickyCayman IslandssrSuriname
cgCongokzKazakhstanssSouth Sudan
chSwitzerlandlaLao People's Democratic RepublicstSao Tome and Principe
ciCôte d'IvoirelbLebanonsvEl Salvador
ckCook IslandslcSaint LuciasxSint Maarten (Dutch part)
clChileliLiechtensteinsySyrian Arab Republic
cmCameroonlkSri LankaszEswatini
cnChinalrLiberiatcTurks and Caicos Islands
coColombialsLesothotdChad
crCosta RicaltLithuaniatfFrench Southern Territories
cuCubaluLuxembourgtgTogo
cvCabo VerdelvLatviathThailand
cwCuraçaolyLibyatjTajikistan
cxChristmas IslandmaMoroccotkTokelau
cyCyprusmcMonacotlTimor-Leste
czCzechiamdMoldova, Republic oftmTurkmenistan
deGermanymeMontenegrotnTunisia
djDjiboutimfSaint Martin (French part)toTonga
dkDenmarkmgMadagascartrTürkiye
dmDominicamhMarshall IslandsttTrinidad and Tobago
doDominican RepublicmkNorth MacedoniatvTuvalu
dzAlgeriamlMalitwTaiwan, Province of China
ecEcuadormmMyanmartzTanzania, United Republic of
eeEstoniamnMongoliauaUkraine
egEgyptmoMacaougUganda
ehWestern SaharampNorthern Mariana IslandsumUnited States Minor Outlying Islands
erEritreamqMartiniqueusUnited States of America
esSpainmrMauritaniauyUruguay
etEthiopiamsMontserratuzUzbekistan
fiFinlandmtMaltavaHoly See
fjFijimuMauritiusvcSaint Vincent and the Grenadines
fkFalkland Islands (Malvinas)mvMaldivesveVenezuela (Bolivarian Republic of)
fmMicronesia (Federated States of)mwMalawivgVirgin Islands (British)
foFaroe IslandsmxMexicoviVirgin Islands (U.S.)
frFrancemyMalaysiavnViet Nam
gaGabonmzMozambiquevuVanuatu
gbUnited Kingdom of Great Britain and Northern IrelandnaNamibiawfWallis and Futuna
gdGrenadancNew CaledoniawsSamoa
geGeorgianeNigeryeYemen
gfFrench GuiananfNorfolk IslandytMayotte
ggGuernseyngNigeriazaSouth Africa
ghGhananiNicaraguazmZambia
giGibraltarnlNetherlandszwZimbabwe

You're also free to pass your own headers set to the request

Language codes

If you want to define the language in your request, you may set the language (string) parameter with one language tag at the creation of the request.

Language codes can be found in the collapsible table below:

All language codes/tags (click here to expand)
Language TagLanguageRegionDescription
ar-SAArabicSaudi ArabiaArabic (Saudi Arabia)
bn-BDBanglaBangladeshBangla (Bangladesh)
bn-INBanglaIndiaBangla (India)
cs-CZCzechCzech RepublicCzech (Czech Republic)
da-DKDanishDenmarkDanish (Denmark)
de-ATGermanAustriaAustrian German
de-CHGermanSwitzerland"Swiss" German
de-DEGermanGermanyStandard German (as spoken in Germany)
el-GRGreekGreeceModern Greek
en-AUEnglishAustraliaAustralian English
en-CAEnglishCanadaCanadian English
en-GBEnglishUnited KingdomBritish English
en-IEEnglishIrelandIrish English
en-INEnglishIndiaIndian English
en-NZEnglishNew ZealandNew Zealand English
en-USEnglishUnited StatesUS English
en-ZAEnglishSouth AfricaEnglish (South Africa)
es-ARSpanishArgentinaArgentine Spanish
es-CLSpanishChileChilean Spanish
es-COSpanishColumbiaColombian Spanish
es-ESSpanishSpainCastilian Spanish (as spoken in Central-Northern Spain)
es-MXSpanishMexicoMexican Spanish
es-USSpanishUnited StatesAmerican Spanish
fi-FIFinnishFinlandFinnish (Finland)
fr-BEFrenchBelgiumBelgian French
fr-CAFrenchCanadaCanadian French
fr-CHFrenchSwitzerland"Swiss" French
fr-FRFrenchFranceStandard French (especially in France)
he-ILHebrewIsraelHebrew (Israel)
hi-INHindiIndiaHindi (India)
hu-HUHungarianHungaryHungarian (Hungary)
id-IDIndonesianIndonesiaIndonesian (Indonesia)
it-CHItalianSwitzerland"Swiss" Italian
it-ITItalianItalyStandard Italian (as spoken in Italy)
ja-JPJapaneseJapanJapanese (Japan)
ko-KRKoreanRepublic of KoreaKorean (Republic of Korea)
nl-BEDutchBelgiumBelgian Dutch
nl-NLDutchThe NetherlandsStandard Dutch (as spoken in The Netherlands)
no-NONorwegianNorwayNorwegian (Norway)
pl-PLPolishPolandPolish (Poland)
pt-BRPortugeseBrazilBrazilian Portuguese
pt-PTPortugesePortugalEuropean Portuguese (as written and spoken in Portugal)
ro-RORomanianRomaniaRomanian (Romania)
ru-RURussianRussian FederationRussian (Russian Federation)
sk-SKSlovakSlovakiaSlovak (Slovakia)
sv-SESwedishSwedenSwedish (Sweden)
ta-INTamilIndiaIndian Tamil
ta-LKTamilSri LankaSri Lankan Tamil
th-THThaiThailandThai (Thailand)
tr-TRTurkishTurkeyTurkish (Turkey)
zh-CNChineseChinaMainland China, simplified characters
zh-HKChineseHond KongHong Kong, traditional characters
zh-TWChineseTaiwanTaiwan, traditional characters

Curl

curl -X POST "https://scrape.infatica.io/" -d '{"api_key": "API_KEY", "url": "https://www.google.com"}'

Curl (with headers)

curl -X POST "https://scrape.infatica.io/" -d '{
"api_key": "API_KEY",
"url": "https://www.google.com",
"headers": {
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Sec-Fetch-Site": "none",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-User": "?1",
"Sec-Fetch-Dest": "document",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9"
}
}'
Using headers:

If you’re trying to set your own headers - please make sure to pass all the necessary values including user agent in the correct order. In this case your target server will receive your headers without any modifications from our side. Setting incorrect headers might cause unexpected page results. Please use this only if you know what you are doing.

Python

import requests
import json

req = requests.post('https://scrape.infatica.io/', data = json.dumps({
'url': 'TARGET_URL',
'api_key': 'API_KEY',
'country_code': 'us', # country_code parameter is optional
'headers': { # headers parameter is optional
'user_header_1': 'header1_value',
'user_header_2': 'header2_value'
}
}))

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

Javascript / NodeJS

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'TARGET_URL',
api_key: 'API_KEY',
country_code: 'gb' // country_code parameter is optional
},
url: 'https://scrape.infatica.io'
}

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

Async API

Async API allows to put multiple time-consuming requests to the queue and receive the results as soon as they are getting ready

POST https://scrape.infatica.io/job

Payload parameters

Payload parameters you can find here in table.

Returns

Status codeDescriptionExample
200 (Success)Request successful. Returns JSON with headers and html fields{"id":'result_id'}
401 (Unauthorized)API key is missing or wrong{'error':'API key is missing or wrong'}
422 (Unprocessable Entity)Error in query parameters{'error':'Wrong query'}
504 (Timeout)Site returned timeout after 3 attempts to reach it{'error':'Timeout'}

Curl

curl -X POST -d '{"api_key": "API_KEY", "url": "http://httpbin.org/ip"}' "https://scrape.infatica.io/job"

Python

import requests
import json

req = requests.post('https://scrape.infatica.io/job', data = json.dumps({
'url': 'TARGET_URL',
'api_key': 'API_KEY',
'country_code': 'us', # country_code parameter is optional
'headers': { # headers parameter is optional
'user_header_1': 'header1_value',
'user_header_2': 'header2_value'
}
}))

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

Javascript / NodeJS

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
url: 'TARGET_URL',
api_key: 'API_KEY',
country_code: 'gb' //country_code parameter is optional
},
url: 'https://scrape.infatica.io/job'
}

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

Async API - receiving results

POST https://scrape.infatica.io/job/<job_id>

Path Parameters

NameDescriptionExampleOptions
job_id (string, required)Job IDhttps://scrape.infatica.io/job/0de32912321default=null

Payload Parameters

NameDescriptionExampleOptions
api_key (string, required)Web Scraper API key{"api_key":"0de32912321"}default=null

Returns

Status codeDescriptionExample
200 (Success)Request successful. Returns JSON with headers and html fields{ <br/> "status":"running", <br/> "statusUrl":"https://scrape.infatica.io/job/0962a8a0-5f1a-4e14-bf8c-5efcc18f1953", <br/> "url":"http://httpbin.org/ip" <br/> }
401 (Unauthorized)API key is missing or wrong{'error':'API key is missing or wrong'}
422 (Unprocessable Entity)Error in query parameters{'error':'Wrong query'}
504 (Timeout)Site returned timeout after 3 attempts to reach it{'error':'Timeout'}

Curl

curl -X POST -d '{"api_key": "API_KEY"}' "https://scrape.infatica.io/job/<job_id>"

Python

import requests
import json

req = requests.post('https://scrape.infatica.io/job/<job_id>', data = json.dumps({
'api_key': 'API_KEY'}))
content = json.loads(req.content)
print(content)

Javascript / NodeJS

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
api_key: 'API_KEY',
},
url: 'https://scrape.infatica.io/job/<job_id>'
}

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

Credits and Requests

Your plan determines how many credits you can use. Each request you make costs some credits. The number of credits you use varies based on the domain and parameters of your request. Geotargeting is included in these credit costs.

Domains

We have built special scrapers for some sites. These scrapers will run when you scrape those domains, changing the credit cost. Scraping other domains costs 1 credit (without additional parameters).

CategoryNormalE-commerceSERP
credit cost11010
with render_js102020
caution

Normal - any other website if no additional parameters are added;

SERP - Google;

Ecommerce - Amazon, Booking;

LinkedIn - the cost will be 130 credits per request.

List will be updated as functionality is added.

These parameters provide you with additional features for the scraping.

{"render_js":"true"} – requests cost 10 credits.