Geotargeting
Route requests through a proxy in a specific country to extract the content your target page serves to visitors in that region.
Tabstack’s extraction and generation endpoints support an optional geo_target parameter that routes the request through a proxy server in the specified country. Use it when the page you’re targeting serves different content based on the visitor’s geographic location.
When geotargeting matters
Section titled “When geotargeting matters”Pricing pages. Many SaaS and e-commerce sites show different prices, currencies, and plan structures based on location. A pricing page viewed from the US may show USD; the same URL from Germany shows EUR with different tiers.
Availability and inventory. Product availability, shipping options, and stock levels are often regionalized.
Localized content. News sites, marketplaces, and media platforms serve regionally relevant content by default.
Compliance monitoring. Verify that cookie banners, consent flows, and legal disclosures appear correctly in specific jurisdictions.
Search results. Some sites return location-aware search results even for identical queries.
Pass a geo_target object with a country property set to an ISO 3166-1 alpha-2 country code:
import Tabstack from '@tabstack/sdk'
const client = new Tabstack({ apiKey: process.env.TABSTACK_API_KEY })
// Extract pricing as seen from Germanyconst result = await client.extract.json({url: 'https://example.com/pricing',geo_target: { country: 'DE' },nocache: true, // Always fresh for regional pricingjson_schema: {type: 'object',properties: {plans: {type: 'array',items: {type: 'object',properties: {name: { type: 'string' },price: { type: 'number', description: 'Price as a number in local currency' },currency: { type: 'string', description: '3-letter currency code, e.g. EUR, USD' }}}}}}})result = client.extract.json( url='https://example.com/pricing', geo_target={'country': 'DE'}, nocache=True, json_schema={...})# Extract pricing as seen from Germanytabstack extract json https://example.com/pricing \ --schema @schema.json \ --geo DE \ --nocachecurl -X POST https://api.tabstack.ai/v1/extract/json \ -H "Authorization: Bearer $TABSTACK_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/pricing", "geo_target": { "country": "DE" }, "nocache": true, "json_schema": { "type": "object" } }'Common country codes
Section titled “Common country codes”| Code | Country |
|---|---|
US | United States |
GB | United Kingdom |
DE | Germany |
FR | France |
JP | Japan |
AU | Australia |
CA | Canada |
BR | Brazil |
IN | India |
SG | Singapore |
Full list: ISO 3166-1 alpha-2 codes
Multi-region extraction
Section titled “Multi-region extraction”To compare a page across multiple regions, run parallel requests with different geo_target values:
const regions = ['US', 'GB', 'DE', 'JP']
const results = await Promise.all(regions.map(country =>client.extract.json({url: 'https://example.com/pricing',geo_target: { country },nocache: true,json_schema: {/* pricing schema */}}).then(result => ({ country, result }))))
for (const { country, result } of results) {console.log(`${country}:`, result)}from concurrent.futures import ThreadPoolExecutor
regions = ["US", "GB", "DE", "JP"]
def fetch(country): result = client.extract.json( url="https://example.com/pricing", geo_target={"country": country}, nocache=True, json_schema={...}, # pricing schema ) return country, result
with ThreadPoolExecutor() as executor: results = executor.map(fetch, regions)
for country, result in results: print(f"{country}:", result)for country in US GB DE JP; do curl -X POST https://api.tabstack.ai/v1/extract/json \ -H "Authorization: Bearer $TABSTACK_API_KEY" \ -H "Content-Type: application/json" \ -d "{ \"url\": \"https://example.com/pricing\", \"geo_target\": { \"country\": \"$country\" }, \"nocache\": true, \"json_schema\": { \"type\": \"object\" } }"donegeo_target is available on /extract/json, /extract/markdown, /generate/json, and /automate. Only /research does not support it: it selects and routes its own sources across regions, so there is no single region to target.
Caching is per-URL. If you’ve previously extracted a URL without geo_target, setting it and using nocache: true ensures a fresh regional fetch rather than a cached neutral-region result.