openapi: 3.0.0
servers:
  - url: https://api.getthedata.com
info:
  contact:
    email: info@getthedata.com
    name: bng2latlong
    url: https://www.getthedata.com/bng2latlong
    x-twitter: getthedatacom
  description: Convert an OSGB36 easting and northing (British National Grid) to WGS84 latitude and longitude.
  title: bng2latlong
  version: "1.0"
  x-apisguru-categories:
    - location
  x-logo:
    url: https://twitter.com/getthedatacom/profile_image?size=original
  x-origin:
    - converter:
        url: https://github.com/mermade/oas-kit
        version: 7.0.4
      format: openapi
      url: https://www.getthedata.com/bng2latlong/openapi
      version: "3.0"
  x-providerName: getthedata.com
  x-serviceName: bng2latlong
externalDocs:
  description: Full documentation
  url: https://www.getthedata.com/bng2latlong
paths:
  "/bng2latlong/{easting}/{northing}":
    get:
      description: |
        Takes an OSGB36 easting and northing (British National Grid) and returns the geographically equivalent WGS84 latitude and longitude.
        #### A successful request returns the following fields:
        * status - this will be `ok`
        * easting - the easting provided in the request
        * northing - the northing provided in the request
        * latitude - the latitude of the converted coordinates
        * longitude - the longitude of the converted coordinates
        #### An unsuccessful request returns the following fields:
        * status - this will be `error`
        * error - an error message
      parameters:
        - description: An OSGB36 (British National Grid) easting.
          example: 326897
          in: path
          name: easting
          required: true
          schema:
            type: integer
        - description: An OSGB36 (British National Grid) northing.
          example: 673919
          in: path
          name: northing
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  easting:
                    example: 326897
                    type: integer
                  error:
                    example: Both <easting> and <northing> must be provided, must be positive integers, and must be within range.
                    type: string
                  latitude:
                    example: 55.95271
                    type: number
                  longitude:
                    example: -3.17227
                    type: number
                  northing:
                    example: 673919
                    type: integer
                  status:
                    enum:
                      - ok
                      - error
                    type: string
                type: object
          description: A JSON object containing the original easting and northing, and the converted latitude and longitude.
      summary: Returns latitude and longitude for the given easting and northing.
