---
title: "Returns the current location."
method: GET
path: "/loc"
tags: ["single"]
---

# Returns the current location.

`GET /loc`

## Request

- Base URL: `https://ipinfo.io`
- URL: `https://ipinfo.io/loc`
- Auth: one of:
  - HTTP basic
  - HTTP bearer
  - API key in query parameter `token`
- TypeScript: <https://skmtc.dev/ipinfo/apis/ipinfo-io-openapi-specification/docs/loc/get.ts> (a function with typed inputs; its response is checked against the schema)

The '/loc' API endpoint provides the geographical location of a user's IP address in a response with latitude and longitude in comma-separated text format.

## Response `200`

Geographic coordinate of the IP address in the format of `<latitude>, <longitude>`.

## Other responses

- `403`: Unknown token or invalid permission. We return the same error for blocking malicious IP addresses as well.
- `429`: Allocated API rate limit has been reached for the token. The user will be prompted with options to increase their API limit.
- `500`: Internal server error or server unavailable.

---

[API](https://skmtc.dev/ipinfo/apis/ipinfo-io-openapi-specification.md) - [All operations](https://skmtc.dev/ipinfo/apis/ipinfo-io-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/ipinfo/apis/ipinfo-io-openapi-specification/revisions/c63f11e4f26e?raw)
