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 theAccept-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):
Field | Type | Required? | Description |
---|---|---|---|
url | string | yes | The URL to fetch (e.g. "https://www.example.com" ) |
api_key | string | yes | Your API key, "api_key":"0de32912321" |
country | string | no | ISO 3166-1 alpha-2 code (e.g. "US" , "GB" , "DE" ). Uses localized proxy |
language | string | no | Language code in "xx_YY" format (e.g., "en_US" , "de_DE" ) |
return_html | boolean | no | true 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 Code | Cause |
---|---|
401 | Invalid API key; Not enough prepaid credits; Missing API key |
403 | The account is suspended |
400 | The provided country is not a valid ISO 3166-1 code |
422 | The request body fails validation |
500 | Server 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)
Code | Country name | Code | Country name | Code | Country name |
---|---|---|---|---|---|
AD | Andorra | GL | Greenland | NO | Norway |
AE | United Arab Emirates | GM | Gambia | NP | Nepal |
AF | Afghanistan | GN | Guinea | NR | Nauru |
AG | Antigua and Barbuda | GP | Guadeloupe | NU | Niue |
AI | Anguilla | GQ | Equatorial Guinea | NZ | New Zealand |
AL | Albania | GR | Greece | OM | Oman |
AM | Armenia | GS | South Georgia and the South Sandwich Islands | PA | Panama |
AO | Angola | GT | Guatemala | PE | Peru |
AQ | Antarctica | GU | Guam | PF | French Polynesia |
AR | Argentina | GW | Guinea-Bissau | PG | Papua New Guinea |
AS | American Samoa | GY | Guyana | PH | Philippines |
AT | Austria | HK | Hong Kong | PK | Pakistan |
AU | Australia | HM | Heard Island and McDonald Islands | PL | Poland |
AW | Aruba | HN | Honduras | PM | Saint Pierre and Miquelon |
AX | Åland Islands | HR | Croatia | PN | Pitcairn |
AZ | Azerbaijan | HT | Haiti | PR | Puerto Rico |
BA | Bosnia and Herzegovina | HU | Hungary | PS | Palestine, State of |
BB | Barbados | ID | Indonesia | PT | Portugal |
BD | Bangladesh | IE | Ireland | PW | Palau |
BE | Belgium | IL | Israel | PY | Paraguay |
BF | Burkina Faso | IM | Isle of Man | QA | Qatar |
BG | Bulgaria | IN | India | RE | Réunion |
BH | Bahrain | IO | British Indian Ocean Territory | RO | Romania |
BI | Burundi | IQ | Iraq | RS | Serbia |
BJ | Benin | IR | Iran (Islamic Republic of) | RU | Russian Federation |
BL | Saint Barthélemy | IS | Iceland | RW | Rwanda |
BM | Bermuda | IT | Italy | SA | Saudi Arabia |
BN | Brunei Darussalam | JE | Jersey | SB | Solomon Islands |
BO | Bolivia (Plurinational State of) | JM | Jamaica | SC | Seychelles |
BQ | Bonaire, Sint Eustatius and Saba | JO | Jordan | SD | Sudan |
BR | Brazil | JP | Japan | SE | Sweden |
BS | Bahamas | KE | Kenya | SG | Singapore |
BT | Bhutan | KG | Kyrgyzstan | SH | Saint Helena, Ascension and Tristan da Cunha |
BV | Bouvet Island | KH | Cambodia | SI | Slovenia |
BW | Botswana | KI | Kiribati | SJ | Svalbard and Jan Mayen |
BY | Belarus | KM | Comoros | SK | Slovakia |
BZ | Belize | KN | Saint Kitts and Nevis | SL | Sierra Leone |
CA | Canada | KP | Korea (Democratic People's Republic of) | SM | San Marino |
CC | Cocos (Keeling) Islands | KR | Korea, Republic of | SN | Senegal |
CD | Congo, Democratic Republic of the | KW | Kuwait | SO | Somalia |
CF | Central African Republic | KY | Cayman Islands | SR | Suriname |
CG | Congo | KZ | Kazakhstan | SS | South Sudan |
CH | Switzerland | LA | Lao People's Democratic Republic | ST | Sao Tome and Principe |
CI | Côte d'Ivoire | LB | Lebanon | SV | El Salvador |
CK | Cook Islands | LC | Saint Lucia | SX | Sint Maarten (Dutch part) |
CL | Chile | LI | Liechtenstein | SY | Syrian Arab Republic |
CM | Cameroon | LK | Sri Lanka | SZ | Eswatini |
CN | China | LR | Liberia | TC | Turks and Caicos Islands |
CO | Colombia | LS | Lesotho | TD | Chad |
CR | Costa Rica | LT | Lithuania | TF | French Southern Territories |
CU | Cuba | LU | Luxembourg | TG | Togo |
CV | Cabo Verde | LV | Latvia | TH | Thailand |
CW | Curaçao | LY | Libya | TJ | Tajikistan |
CX | Christmas Island | MA | Morocco | TK | Tokelau |
CY | Cyprus | MC | Monaco | TL | Timor-Leste |
CZ | Czechia | MD | Moldova, Republic of | TM | Turkmenistan |
DE | Germany | ME | Montenegro | TN | Tunisia |
DJ | Djibouti | MF | Saint Martin (French part) | TO | Tonga |
DK | Denmark | MG | Madagascar | TR | Türkiye |
DM | Dominica | MH | Marshall Islands | TT | Trinidad and Tobago |
DO | Dominican Republic | MK | North Macedonia | TV | Tuvalu |
DZ | Algeria | ML | Mali | TW | Taiwan, Province of China |
EC | Ecuador | MM | Myanmar | TZ | Tanzania, United Republic of |
EE | Estonia | MN | Mongolia | UA | Ukraine |
EG | Egypt | MO | Macao | UG | Uganda |
EH | Western Sahara | MP | Northern Mariana Islands | UM | United States Minor Outlying Islands |
ER | Eritrea | MQ | Martinique | US | United States of America |
ES | Spain | MR | Mauritania | UY | Uruguay |
ET | Ethiopia | MS | Montserrat | UZ | Uzbekistan |
FI | Finland | MT | Malta | VA | Holy See |
FJ | Fiji | MU | Mauritius | VC | Saint Vincent and the Grenadines |
FK | Falkland Islands (Malvinas) | MV | Maldives | VE | Venezuela (Bolivarian Republic of) |
FM | Micronesia (Federated States of) | MW | Malawi | VG | Virgin Islands (British) |
FO | Faroe Islands | MX | Mexico | VI | Virgin Islands (U.S.) |
FR | France | MY | Malaysia | VN | Viet Nam |
GA | Gabon | MZ | Mozambique | VU | Vanuatu |
GB | United Kingdom of Great Britain and Northern Ireland | NA | Namibia | WF | Wallis and Futuna |
GD | Grenada | NC | New Caledonia | WS | Samoa |
GE | Georgia | NE | Niger | YE | Yemen |
GF | French Guiana | NF | Norfolk Island | YT | Mayotte |
GG | Guernsey | NG | Nigeria | ZA | South Africa |
GH | Ghana | NI | Nicaragua | ZM | Zambia |
GI | Gibraltar | NL | Netherlands | ZW | Zimbabwe |
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 Tag | Language | Region | Description |
---|---|---|---|
ar-SA | Arabic | Saudi Arabia | Arabic (Saudi Arabia) |
bn-BD | Bangla | Bangladesh | Bangla (Bangladesh) |
bn-IN | Bangla | India | Bangla (India) |
cs-CZ | Czech | Czech Republic | Czech (Czech Republic) |
da-DK | Danish | Denmark | Danish (Denmark) |
de-AT | German | Austria | Austrian German |
de-CH | German | Switzerland | "Swiss" German |
de-DE | German | Germany | Standard German (as spoken in Germany) |
el-GR | Greek | Greece | Modern Greek |
en-AU | English | Australia | Australian English |
en-CA | English | Canada | Canadian English |
en-GB | English | United Kingdom | British English |
en-IE | English | Ireland | Irish English |
en-IN | English | India | Indian English |
en-NZ | English | New Zealand | New Zealand English |
en-US | English | United States | US English |
en-ZA | English | South Africa | English (South Africa) |
es-AR | Spanish | Argentina | Argentine Spanish |
es-CL | Spanish | Chile | Chilean Spanish |
es-CO | Spanish | Columbia | Colombian Spanish |
es-ES | Spanish | Spain | Castilian Spanish (as spoken in Central-Northern Spain) |
es-MX | Spanish | Mexico | Mexican Spanish |
es-US | Spanish | United States | American Spanish |
fi-FI | Finnish | Finland | Finnish (Finland) |
fr-BE | French | Belgium | Belgian French |
fr-CA | French | Canada | Canadian French |
fr-CH | French | Switzerland | "Swiss" French |
fr-FR | French | France | Standard French (especially in France) |
he-IL | Hebrew | Israel | Hebrew (Israel) |
hi-IN | Hindi | India | Hindi (India) |
hu-HU | Hungarian | Hungary | Hungarian (Hungary) |
id-ID | Indonesian | Indonesia | Indonesian (Indonesia) |
it-CH | Italian | Switzerland | "Swiss" Italian |
it-IT | Italian | Italy | Standard Italian (as spoken in Italy) |
ja-JP | Japanese | Japan | Japanese (Japan) |
ko-KR | Korean | Republic of Korea | Korean (Republic of Korea) |
nl-BE | Dutch | Belgium | Belgian Dutch |
nl-NL | Dutch | The Netherlands | Standard Dutch (as spoken in The Netherlands) |
no-NO | Norwegian | Norway | Norwegian (Norway) |
pl-PL | Polish | Poland | Polish (Poland) |
pt-BR | Portugese | Brazil | Brazilian Portuguese |
pt-PT | Portugese | Portugal | European Portuguese (as written and spoken in Portugal) |
ro-RO | Romanian | Romania | Romanian (Romania) |
ru-RU | Russian | Russian Federation | Russian (Russian Federation) |
sk-SK | Slovak | Slovakia | Slovak (Slovakia) |
sv-SE | Swedish | Sweden | Swedish (Sweden) |
ta-IN | Tamil | India | Indian Tamil |
ta-LK | Tamil | Sri Lanka | Sri Lankan Tamil |
th-TH | Thai | Thailand | Thai (Thailand) |
tr-TR | Turkish | Turkey | Turkish (Turkey) |
zh-CN | Chinese | China | Mainland China, simplified characters |
zh-HK | Chinese | Hond Kong | Hong Kong, traditional characters |
zh-TW | Chinese | Taiwan | Taiwan, traditional characters |