---
title: "Diagnose marketplace region detection for the calling client"
method: GET
path: "/api/debug-region"
tags: ["ops"]
---

# Diagnose marketplace region detection for the calling client

`GET /api/debug-region`

## Request

- Base URL: `https://voltplan.app`
- URL: `https://voltplan.app/api/debug-region`
- Auth: none declared

Returns the region the affiliate redirects would pick for this request together with the inputs used: client IP from `X-Forwarded-For`/`X-Real-IP`, the GeoIP lookup, `Accept-Language` and all `x-*`, `accept-language` and `host` request headers. Detection order: `region`/`country` query parameter, `X-VoltPlan-Region`/`X-VoltPlan-Country` header, CDN country headers, GeoIP, `Accept-Language`, default `us`.

## Query parameters

- `region` string
- `country` string

## Response `200`

Detected region and detection inputs.

- DebugRegion: Region detection result and the request data it was derived from.
  - `detectedRegion` 'de' | 'us' | 'uk' | 'fr' | 'es' | 'it' | 'au', required: Amazon marketplace region chosen for this request.
  - `clientIp` string, nullable, required: First `X-Forwarded-For` entry, else `X-Real-IP`.
  - `xForwardedFor` string, nullable, required
  - `xRealIp` string, nullable, required
  - `geoResult` union, required: GeoIP lookup for `clientIp`; null without a client IP or without a match; `{ error }` when geoip-lite cannot be loaded.
    - GeoIpLookup: geoip-lite lookup result. The runtime image ships only the country database, so `region`, `city`, `timezone` and `eu` are empty and `ll` is `[null, null]`; `metro` and `area` come only with the city database.
      - `range` integer[], required
      - `country` string, required: ISO 3166-1 alpha-2 code.
      - `region` string, required
      - `eu` '' | '0' | '1', required
      - `timezone` string, required
      - `city` string, required
      - `ll` number[], required: Latitude, longitude.
      - `metro` integer
      - `area` integer: Accuracy radius in km.
    - ErrorResponse: Error body returned by VoltPlan REST endpoints.
      - `error` string, required: Human-readable error message.
      - `details` string: Optional extra context about the failure.
  - `acceptLanguage` string, nullable, required
  - `allHeaders` object, required: Request headers starting with `x-` plus `accept-language` and `host`.

---

[API](https://skmtc.dev/voltplan/apis/voltplan-api.md) · [All operations](https://skmtc.dev/voltplan/apis/voltplan-api/llms.txt) · [OpenAPI document](https://skmtc.dev/voltplan/apis/voltplan-api/revisions/575b86a7af92?raw)
