openapi: 3.0.0
servers:
  - url: https://api.ip2location.io
info:
  description: IP2Location.io IP Geolocation API provides RESTful API to obtain visitors’ geolocation information such as country, region, district, city, latitude & longitude, ZIP code, time zone, ASN, ISP, domain, net speed, IDD code, area code, weather station data, MNC, MCC, mobile brand, elevation, usage type, address type, advertisement category, ASN and proxy data with an IP address.
  title: IP2Location.io IP Geolocation API
  version: "1.0"
  x-apisguru-categories:
    - developer_tools
  x-logo:
    url: https://cdn.ip2location.io/assets/img/icons/android-chrome-512x512.png
  x-origin:
    - format: openapi
      url: https://api.swaggerhub.com/apis/ip2location/ip2location-io-ip-geolocation-api/1.0
      version: "3.0"
  x-providerName: ip2location.io
paths:
  /:
    get:
      description: Geolocate user's location information via IP address
      parameters:
        - description: API key.
          in: query
          name: key
          required: true
          schema:
            type: string
        - description: IP address (IPv4 or IPv6) for reverse IP location lookup purposes. If not present, the server IP address will be used for the location lookup.
          in: query
          name: ip
          required: true
          schema:
            example: 8.8.8.8
            type: string
        - description: Format of the response message.
          in: query
          name: format
          schema:
            enum:
              - json
              - xml
            type: string
        - description: Translation information. The translation only applicable for continent, country, region and city name. This parameter is only available for Plus and Security plan only.
          in: query
          name: lang
          schema:
            enum:
              - ar
              - cs
              - da
              - de
              - en
              - es
              - et
              - fi
              - fr
              - ga
              - it
              - ja
              - ko
              - ms
              - nl
              - pt
              - ru
              - sv
              - tr
              - vi
              - zh-cn
              - zh-tw
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                "0":
                  value: |-
                    ip: '' country_code: '' country_name: '' region_name: '' city_name: '' latitude: null longitude: null zip_code: '' time_zone: '' asn: '' as: '' isp: '' domain: '' net_speed: '' idd_code: '' area_code: '' weather_station_code: '' weather_station_name: '' mcc: '' mnc: '' mobile_brand: '' elevation: null usage_type: '' address_type: '' continent:
                      name: ''
                      code: ''
                      hemisphere: []
                      translation:
                        lang: null
                        value: null
                    district: '' country:
                      name: ''
                      alpha3_code: ''
                      numeric_code: null
                      demonym: ''
                      flag: ''
                      capital: ''
                      total_area: null
                      population: null
                      currency:
                        code: ''
                        name: ''
                        symbol: ''
                      language:
                        code: ''
                        name: ''
                      tld: us
                      translation:
                        lang: null
                        value: null
                    region:
                      name: ''
                      code: ''
                      translation:
                        lang: ''
                        value: ''
                    city:
                      name: ''
                      translation:
                        lang: null
                        value: null
                    time_zone_info:
                      olson: ''
                      current_time: ''
                      gmt_offset: null
                      is_dst: boolean
                      sunrise: ''
                      sunset: ''
                    geotargeting:
                      metro: ''
                    ads_category: '' ads_category_name: '' is_proxy: boolean proxy:
                      last_seen: null
                      proxy_type: ''
                      threat: ''
                      provider: ''
          description: Get response from IP lookup
