openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/geolocation-api/find
info:
  title: "GeoLocation API: Uncover Geographical Insights with Accuracy and Speed"
  version: 1.0.1
  description: Get detailed geolocation information for any given IP address
paths:
  /{ip}:
    get:
      summary: Get Geolocation for IP
      description: Returns geolocation information for a given IP address.
      parameters:
        - name: ip
          in: path
          required: true
          description: The IP address to get geolocation information for.
          schema:
            type: string
            format: ip
      responses:
        "200":
          description: A successful response with geolocation data.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GeolocationResponse"
        "400":
          description: Bad request if the IP format is incorrect.
        "404":
          description: Not found if the IP address does not exist in the database.
      security:
        - basicAuth: []
    parameters:
      - description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
components:
  schemas:
    GeolocationResponse:
      type: object
      properties:
        country:
          type: string
          example: GB
        stateprov:
          type: string
          example: Lambeth
          nullable: true
        stateprovCode:
          type: string
          example: LBH
          nullable: true
        city:
          type: string
          example: Lambeth
          nullable: true
        latitude:
          type: string
          format: double
          example: "51.4885"
        longitude:
          type: string
          format: double
          example: "-0.1262"
        continent:
          type: string
          example: EU
        timezone:
          type: string
          example: Europe/London
        accuracyRadius:
          type: integer
          format: int32
          example: 10
        asn:
          type: integer
          format: int32
          example: 56478
        asnOrganization:
          type: string
          example: Hyperoptic Ltd
          nullable: true
        asnNetwork:
          type: string
          example: 2a01:4b00:0:0:0:0:0:0/32
          nullable: true
  securitySchemes: {}
security: {}
tags:
  - name: location
    description: Operations related to location
  - name: mapping
    description: Operations related to mapping
