Skip to content
Proxy · Use case

Fetch geo-restricted pages from the country they are meant for

To fetch a website from another country, the request has to leave from an IP in that country; a header or a VPN on your laptop does not help a server-side job. Streaming catalogs, regional news, government portals, local marketplaces and country-only launches all answer foreign traffic with a block page, a redirect or a trimmed version. One request option moves the exit to the country you name, on every Microlink product.

The problem

Geo-restricted content serves your servers a different page, or none

Geo-restrictions read the IP, not your intent. A crawler in a US datacenter asking for a page reserved for Japan gets “not available in your region”, a redirect to the international homepage, or the same URL with half the content missing. The request succeeds, so a pipeline that only checks the status code stores the wrong page.

The workarounds cost more than the fetch. A VPN covers one country at a time and does not belong in a server fleet. Buying a proxy per market means one contract, one credential and one integration per country, plus a way to prove each exit actually sits where the vendor says. Setting Accept-Language changes the language you ask for, not the country you appear to come from.

proxy.location takes a two-letter ISO country code and routes the request through a proxy IP in that country. 181 codes are supported, the default is us, and it works the same for HTML, Markdown, screenshots, PDFs and data extraction. geolocation.microlink.io shows which IP and country the target sees, so you can check the route before trusting the content.

How it works

How to fetch a geo-blocked website from another country

Check the exit once, then fetch the real target with the same country code. Both calls need a Pro key. The geolocation section of the proxy guide shows the same verification with the interactive editor.

1 · Confirm the exit country
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const seen = await microlink.text('https://geolocation.microlink.io', {
  proxy: { location: 'jp' }
})

geolocation.microlink.io reports the IP address and country of whoever requests it. Through proxy.location jp, the text it returns should name Japan, which proves the route before you spend requests on the real target.

2 · Fetch the geo-restricted page
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const markdown = await microlink.markdown('https://example.jp/catalog', {
  proxy: { location: 'jp' },
  headers: { 'x-api-header-accept-language': 'ja-JP' }
})

The page is requested from a Japanese IP and converted to Markdown. The x-api-header- prefix forwards Accept-Language to the site, for pages that negotiate language as well as region.

3 · The same request as a URL
curl 'https://pro.microlink.io/?url=https%3A%2F%2Fexample.jp%2Fcatalog&data.markdown.attr=markdown&proxy.location=jp&meta=false' \
  -H 'x-api-key: $MICROLINK_API_KEY'

proxy.location is a Pro option, so the URL goes to the Pro endpoint with your x-api-key header. An unknown country code is rejected with EINVALQUERY instead of silently falling back.

Parameters used
  • proxy.location ISO 3166-1 alpha-2 code, case-insensitive, 181 countries. Default us. Pro plans.
  • proxy.url Your own proxy instead of a country pin. Exclusive with proxy.location.
  • headers Forwards Accept-Language or other headers the site negotiates on. Pro plans.
  • ttl Keeps each country’s copy cached from 1 minute to 31 days. Pro plans.

The cache key includes every recognized query parameter, as the cache reference explains, so each country gets its own cached copy of the same URL. For a visual record of the regional version, screenshot the site from another country with the same option.

Why it works

Why a country parameter beats a VPN or a proxy per market

Geo-restricted content is a routing problem with a verification problem attached. Keeping both in one API means one integration covers every market.

01 · 181 countries, one option
Change the market by changing two letters.
The exit country is a request option, so a job that covers five markets is five calls with five codes. There is no contract, credential or client per country to maintain.

For prices specifically, scraping prices by country turns the same option into a comparison table.

02 · Verifiable exits
Check the country before you trust the page.
geolocation.microlink.io echoes the IP and country the target sees. Running it with the same proxy.location takes one request and settles whether a strange result is the site or the route.

The response header x-fetch-mode ends in -proxy when the proxy route was used, as the proxy parameter reference shows.

03 · Every output
The same country pin on any product.
proxy.location is a shared option, so the regional page can come back as Markdown for an index, HTML for your parser, a screenshot for evidence or extracted fields for a table, without a second integration per output.

When not to: a region lock enforced by a login, a subscription or a licence is not an IP problem, and a proxy is not the answer. Only fetch regional content you are permitted to access; the pricing page lists which plans include the proxy.

FAQ

How do I fetch a website from another country with an API?

Add proxy.location with the two-letter ISO code of the country, for example jp or de, to a request on a Pro plan. The request leaves through a proxy IP in that country and the site answers as it would to a local visitor.

Which countries can a geo-restricted request come from?

181 countries, each identified by its ISO 3166-1 alpha-2 code. The value is case-insensitive and defaults to us; unknown codes are rejected with EINVALQUERY. The full list is in the proxy.location reference.

How do I check which country a proxied request exits from?

Request geolocation.microlink.io with the same proxy.location. It returns the IP address and country the server sees, which is exactly what the geo-restricted site will see.

Can I access geo-blocked content through my own proxy instead?

Yes. Pass your provider’s URL as proxy.url, for example a country-specific endpoint you already pay for. proxy.url and proxy.location are exclusive, so use one or the other per request.

Does the cache mix up pages fetched from different countries?

No. The cache key is derived from the target URL and all recognized query parameters, proxy.location included, so the Japanese and German versions of the same URL are separate entries. Cache hits never count toward your quota.
Related use cases

Solve the next problem with the same API

Scrape prices by country

One extraction request per market, pinned to its country, merged into a table of comparable prices and currencies.

Bring your own proxy

Pass your authenticated proxy URL per request and every redirect, asset and fetch of the page goes through it.

Rotating proxy alternative

Skip the proxy pool: the API escalates to residential IPs only when a site blocks you and remembers what works per domain.

Screenshot a site from another country

Pin the request to a country with a two-letter code and capture the prices and copy a local visitor sees.

Region-specific metadata

Fetch titles, descriptions and prices as a visitor from a given country and language sees them.

PDFs of bot-protected pages

Print the real page, not the challenge screen: on Pro plans the PDF request reaches protected sites through the built-in proxy.

Ready to fetch from any market?

Two letters per request, 181 countries, one integration. Verify the exit, then fetch the page as locals see it.