GET
/
geoip
declare(strict_types=1);

require 'vendor/autoload.php';

use LukeHagar\Plex_API;

$sdk = Plex_API\PlexAPI::builder()->build();



$response = $sdk->plex->getGeoData(

);

if ($response->geoData !== null) {
    // handle response
}
{
  "code": "VI",
  "continent_code": "NA",
  "country": "United States Virgin Islands",
  "city": "Amsterdam",
  "european_union_member": true,
  "time_zone": "America/St_Thomas",
  "postal_code": 802,
  "in_privacy_restricted_country": true,
  "in_privacy_restricted_region": true,
  "subdivisions": "Saint Thomas",
  "coordinates": "18.3381, -64.8941"
}

Response

200
application/json
Gets the geo location data of the user

Geo location data

code
string
required

The ISO 3166-1 alpha-2 code of the country.

Example:

"VI"

continent_code
string
required

The continent code where the country is located.

Example:

"NA"

country
string
required

The official name of the country.

Example:

"United States Virgin Islands"

city
string
required

The name of the city.

Example:

"Amsterdam"

european_union_member
boolean
default:false
required

Indicates if the country is a member of the European Union.

Example:

true

time_zone
string
required

The time zone of the country.

Example:

"America/St_Thomas"

postal_code
string
required

The postal code of the location.

Example:

"802"

in_privacy_restricted_country
boolean
default:false
required

Indicates if the country has privacy restrictions.

Example:

true

in_privacy_restricted_region
boolean
default:false
required

Indicates if the region has privacy restrictions.

Example:

true

subdivisions
string
required

The name of the primary administrative subdivision.

Example:

"Saint Thomas"

coordinates
string
required

The geographical coordinates (latitude, longitude) of the location.

Example:

"18.3381, -64.8941"