Skip to main content

Web Scraper API documentation

Get to know how Web Scraper API works and integrate it into your app.

Authentication

All requests must include an X-API-Key header with a valid API key. For example:

X-API-Key: YOUR_SECRET_API_KEY

Scraper and API endpoint

POST https://scrape.infatica.io/

  • Purpose: Fetches a webpage at a given URL, optionally using a specified country proxy and/or language headers.
  • Auth: Requires X-API-Key in the request header.
  • Credits: Each call typically consumes 1 credit.

Features:

  • Ability to specify ISO 3166-1 country code (e.g. "US", "GB", "DE") to use a localized proxy.
  • Optionally set language (e.g., "en_US", "de_DE") to shape the Accept-Language header.
  • Return raw HTML (return_html = true) or a JSON structure (return_html = false, default).

Google SERP endpoint

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

  • Purpose: Specialized endpoint for Google Search requests.
  • Auth: Requires X-API-Key in the request header.
  • Credits: Each call consumes 20 credits.

Features:

  • url: The Google search URL.
  • Returns JSON containing HTML, metadata, credits used, etc.

Request body (JSON):

FieldTypeRequired?Description
urlstringyesThe URL to fetch (e.g. "https://www.example.com")
api_keystringyesYour API key, "api_key":"0de32912321"
countrystringnoISO 3166-1 alpha-2 code (e.g. "US", "GB", "DE"). Uses localized proxy
languagestringnoLanguage code in "xx_YY" format (e.g., "en_US", "de_DE")
return_htmlbooleannotrue returns raw HTML; false returns JSON with HTML sample (default)

Example cURL Request:

curl -X POST "https://scrape.infatica.io/" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_SECRET_API_KEY" \
-d '{
"url": "https://www.example.com",
"country": "US",
}'

Success Response

HTTP Status: 200 OK

If return_html = false (default):

{
"status_code": 200,
"credits_used": 1,
"time_spent_ms": 123,
"api_key": "YOUR_SECRET_API_KEY",
"timestamp": "2025-03-25T12:00:00.123456",
"country": "US",
"language": "en_US",
"data": {
"html_sample": "<html><body>Fetched content...</body></html>"
}
}

If return_html = true, the response is raw HTML:

<!DOCTYPE html>
<html>
<head>...</head>
<body>Full HTML of the requested page</body>
</html>

Possible Error Responses

HTTP Status Codes

Status CodeCause
401Invalid API key; Not enough prepaid credits; Missing API key
403The account is suspended
400The provided country is not a valid ISO 3166-1 code
422The request body fails validation
500Server errors or unexpected issues

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.

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

Where US is a two-letter uppercase country code according to ISO 3166-1:

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

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