---
updatedAt: 2026-06-16T12:42:53.000Z
agentTools:
  projectIndex: https://docs.pelcro.com/llms.txt
---

# Visitor location

Return the caller's approximate geolocation (country, region, city, coordinates, timezone), detected from their IP address. Public — no parameters required. Commonly used to pre-select a country or tailor content to the visitor.

## Overview

Return the caller's approximate geolocation — country, region, city, coordinates, and timezone — detected from their IP address. No parameters are required.

The endpoint is served from the global edge for fast, low-latency responses, and is commonly used to pre-select a country or tailor content to the visitor.

> 📘 Duplicate fields
>
> Several fields are returned under more than one name (for example `iso_code`/`countryCode`, `postalCode`/`postal_code`, `latitude`/`lat`) for backward compatibility.

**Example:**

```bash
curl --request GET \
  --url 'https://www.pelcro.com/api/v1/sdk/location'
```

```json
{
  "data": {
    "location": {
      "ip": "203.0.113.10",
      "iso_code": "US",
      "countryCode": "US",
      "city": "New York",
      "region": "New York",
      "regionCode": "NY",
      "postalCode": "10001",
      "continent": "NA",
      "latitude": "40.71427",
      "longitude": "-74.00597",
      "timezone": "America/New_York",
      "isEUCountry": false
    }
  }
}
```

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Open API",
    "version": "1.88"
  },
  "servers": [
    {
      "url": "https://www.pelcro.com/api/v1/sdk/"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "query",
        "name": "site_id"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/location": {
      "get": {
        "description": "Return the caller's approximate geolocation (country, region, city, coordinates, timezone), detected from their IP address. Public — no parameters required. Commonly used to pre-select a country or tailor content to the visitor.",
        "operationId": "get_location",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"data\": {\n    \"location\": {\n      \"ip\": \"203.0.113.10\",\n      \"iso_code\": \"US\",\n      \"countryCode\": \"US\",\n      \"country\": null,\n      \"city\": \"New York\",\n      \"region\": \"New York\",\n      \"regionCode\": \"NY\",\n      \"state_name\": \"New York\",\n      \"state\": \"NY\",\n      \"postalCode\": \"10001\",\n      \"postal_code\": \"10001\",\n      \"continent\": \"NA\",\n      \"latitude\": \"40.71427\",\n      \"longitude\": \"-74.00597\",\n      \"lat\": 40.71427,\n      \"lon\": -74.00597,\n      \"metroCode\": null,\n      \"timezone\": \"America/New_York\",\n      \"currency\": null,\n      \"isEUCountry\": false\n    }\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "location": {
                          "type": "object",
                          "description": "Detected geolocation. Several fields are intentionally duplicated (e.g. `iso_code`/`countryCode`, `postalCode`/`postal_code`, `latitude`/`lat`) for backward compatibility.",
                          "properties": {
                            "ip": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "iso_code": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "countryCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "country": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "city": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "region": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "regionCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "state_name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "state": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "postalCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "postal_code": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "continent": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "latitude": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "longitude": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "lat": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lon": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "metroCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "timezone": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "currency": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "isEUCountry": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [],
        "summary": "Visitor location"
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```

# Sibling pages

* [Overview](https://docs.pelcro.com/reference/api-open-intro.md)
* [Identification](https://docs.pelcro.com/reference/api-open-identification.md)
* [Resources](https://docs.pelcro.com/reference/api-open-resources.md)
* [How to integrate](https://docs.pelcro.com/reference/how-to-integrate.md)
* [Supported Languages](https://docs.pelcro.com/reference/api-open-supported-languages.md)
* [Errors](https://docs.pelcro.com/reference/api-open-errors.md)
* [Site](https://docs.pelcro.com/reference/api-open-site.md)
* [Authentication](https://docs.pelcro.com/reference/api-open-authentication.md)
* [Password](https://docs.pelcro.com/reference/api-open-password.md)
* [Customer](https://docs.pelcro.com/reference/api-open-customer.md)
* [Subscription](https://docs.pelcro.com/reference/api-open-subscription.md)
* [Address](https://docs.pelcro.com/reference/api-open-address.md)
* [Payment methods](https://docs.pelcro.com/reference/api-open-payment-methods.md)
* [Payment](https://docs.pelcro.com/reference/api-open-payment.md)
* [Invoice](https://docs.pelcro.com/reference/api-open-invoice.md)
* [E-commerce](https://docs.pelcro.com/reference/api-open-ecommerce.md)
* [Newsletter](https://docs.pelcro.com/reference/api-open-newsletter.md)
* [Plan](https://docs.pelcro.com/reference/api-open-plan.md)
* [Memberships](https://docs.pelcro.com/reference/api-open-memberships.md)
* [Campaign](https://docs.pelcro.com/reference/campaign.md)
* [Bills](https://docs.pelcro.com/reference/api-open-bills.md)
* [Countries and states](https://docs.pelcro.com/reference/geo.md)
* [Source](https://docs.pelcro.com/reference/api-open-source.md)