---
title: Geolocation
summary: Fastly Geolocation information about an IP address.
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/geolocation/interface.Geolocation/
---

**Kind:** Interface  
**Module:** [geolocation](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/geolocation/)  
**Package:** @fastly/js-compute 4.0.1  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L44

[Fastly Geolocation](https://developer.fastly.com/reference/vcl/variables/geolocation/)
information about an IP address.

Can be retrieved for the incoming request's client IP address using the
[ClientInfo.geo](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/globals/interface.ClientInfo/) accessor, and for arbitrary addresses using
[getGeolocationForIpAddress](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/geolocation/fn.getGeolocationForIpAddress/).

## Properties

### as_name

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L50

The name of the organization associated with `as_number`.

For example, fastly is the value given for IP addresses under AS-54113.

### as_number

**Type:** `number | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L55

[Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number.

### area_code

**Type:** `number | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L62

The telephone area code associated with an IP address.

These are only available for IP addresses in the United States, its territories, and Canada.

### city

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L67

City or town name.

### conn_speed

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L72

Connection speed.

### conn_type

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L77

Connection type.

### continent

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L82

Continent.

### country_code

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L91

A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address.

The US country code is returned for IP addresses associated with overseas United States military bases.

These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands.

### country_code3

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L98

A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address.

The USA country code is returned for IP addresses associated with overseas United States military bases.

### country_name

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L105

Country name.

This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country.

### gmt_offset

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L110

Time zone offset from Greenwich Mean Time (GMT) for `city`.

### latitude

**Type:** `number | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L117

Latitude, in units of degrees from the equator.

Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system.

### longitude

**Type:** `number | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L124

Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian).

Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system.

### metro_code

**Type:** `number | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L129

Metro code, representing designated market areas (DMAs) in the United States.

### postal_code

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L138

The postal code associated with the IP address.

These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States.

For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration.

### proxy_description

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L143

Client proxy description.

### proxy_type

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L148

Client proxy type.

### region

**Type:** `string | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L157

[ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code.

For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision.

This field can be `null` for countries that do not have ISO country subdivision codes. For example, `null` is given for IP addresses assigned to the Åland Islands (country code AX).

### utc_offset

**Type:** `number | null`  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/geolocation.d.ts#L162

Time zone offset from coordinated universal time (UTC) for `city`.
