# convertgeocode: Convert Geocode

> convertgeocode (Convert Geocode) is a 1001fx API function in the group Geo: POST https://api.1001fx.com/geo/convertgeocode, 1 credit per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

Converts a geocode between decimal, DMS (degrees, minutes, seconds) and Exif format. Pass one of the three, get all formats back.

- Group: Geo
- Endpoint: `POST https://api.1001fx.com/geo/convertgeocode`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 1 credit per call
- Ready-made in: Make and n8n
- Docs: https://1001fx.com/functions/convertgeocode

## Parameters

- `decimal` (object, optional) – Decimal: Your geocode in decimal format. Either decimal, dms or exif needs to be provided.
  - `latitude` (number, optional, min -90, max 90) – Latitude: Latitude value to look up.
  - `longitude` (number, optional, min -180, max 180) – Longitude: Longitude value to look up.
  - `full` (string, optional) – Full string: String of combined values seperated by comma
- `dms` (object, optional) – Degrees Minutes Seconds: Your geocode in DMS format. Either decimal, dms or exif needs to be provided.
  - `vertical` (object, optional) – Vertical: Vertical values for your coordinate.
    - `deg` (number, required) – Degrees: Degrees value of your coordinate
    - `min` (number, required) – Minutes: Minute value of your coordinate
    - `sec` (number, required) – Seconds: Seconds value of your coordinate
    - `direction` (enum, required, one of `N`, `S`) – Direction: Vertical direction of your coordinate
  - `horizontal` (object, optional) – Horizontal: Horizontal values for your coordinate.
    - `deg` (number, required) – Degrees: Degrees value of your coordinate
    - `min` (number, required) – Minutes: Minute value of your coordinate
    - `sec` (number, required) – Seconds: Seconds value of your coordinate
    - `direction` (enum, required, one of `E`, `W`) – Direction: Horizontal direction of your coordinate
  - `full` (string, optional) – Full string: String of combined values
- `exif` (object, optional) – Degrees Minutes Seconds: Your geocode in Exif format. Either decimal, dms or exif needs to be provided.
  - `android` (object, optional) – Android Exif Data: Exif data
    - `latitudeRef` (enum, required, one of `N`, `S`) – Latitude Ref: Latitude Ref
    - `latitude` (string, required) – Latitude: Latitude value
    - `longitudeRef` (enum, required, one of `E`, `W`) – Latitude Ref: Latitude Ref
    - `longitude` (string, required) – Longitude: Longitude value
  - `ios` (object, optional) – iOS Exif Data: Exif data
    - `latitudeRef` (enum, required, one of `N`, `S`) – Latitude Ref: Latitude Ref
    - `latitude` (array<array>, required) – Latitude: Latitude values
    - `longitudeRef` (enum, required, one of `E`, `W`) – Latitude Ref: Latitude Ref
    - `longitude` (array<array>, required) – Longitude: Longitude values

## Example: From a decimal string

```bash
curl -X POST 'https://api.1001fx.com/geo/convertgeocode' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"decimal":{"full":"50.11046833333334,8.68165861111111"}}'
```

Answer (HTTP 200):

```json
{
  "result": {
    "decimal": {
      "latitude": 50.11046833333334,
      "longitude": 8.68165861111111,
      "full": "50.11046833333334,8.68165861111111"
    },
    "dms": {
      "vertical": {
        "deg": 50,
        "min": 6,
        "sec": 37.686000000012996,
        "direction": "N"
      },
      "horizontal": {
        "deg": 8,
        "min": 40,
        "sec": 53.970999999998526,
        "direction": "E"
      },
      "full": "50°6'37.686000000012996\"N 8°40'53.970999999998526\"E"
    },
    "exif": {
      "ios": {
        "GPSLatitudeRef": "N",
        "GPSLatitude": [
          [
            50,
            1
          ],
          [
            6,
            1
          ],
          [
            3768.6000000012996,
            100
          ]
        ],
        "GPSLongitudeRef": "E",
… (24 more lines)
```
