# Geo Data distance between two places API

Calculate Geo Data great-circle distances between names or coordinates via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as from, output, raw, and retrieve structured data including great-circle distance in kilometres, great-circle distance in miles, initial bearing in degrees, resolved origin latitude, and resolved destination latitude for geographic comparison, and map context.

Documentation: https://openany.si/market/apis/geo-data/geo-data-distance-between-two-places-api/?offering=05ffb3bb-886c-4fe4-8f18-ca26bf718cac
API ID: 05ffb3bb-886c-4fe4-8f18-ca26bf718cac
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/geo/v1/distance
Page update time: 2026-12-03T02:47:13.616Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract. Price update time: not supplied.
Contract update time: 2026-12-03T02:47:13.023Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Geo Data distance between two places API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "description": "Place name or `lat,lon`."
        },
        "to": {
          "type": "string",
          "description": "Place name or `lat,lon`."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row."
        }
      },
      "required": [
        "from",
        "to"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "attribution": {
      "type": "string"
    },
    "cached": {
      "type": "boolean"
    },
    "credits_used": {
      "type": "integer"
    },
    "distance_km": {
      "type": "number"
    },
    "distance_mi": {
      "type": "number"
    },
    "distance_nmi": {
      "type": "number"
    },
    "fetched_at": {
      "type": "string"
    },
    "from": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "lon": {
          "type": "number"
        },
        "place": {
          "type": "object",
          "properties": {
            "admin1": {
              "type": "string"
            },
            "admin1_code": {
              "type": "string"
            },
            "admin2": {
              "type": "string"
            },
            "ascii_name": {
              "type": "string"
            },
            "country": {
              "type": "string"
            },
            "country_code": {
              "type": "string"
            },
            "elevation_m": {
              "type": "integer"
            },
            "feature": {
              "type": "string"
            },
            "feature_code": {
              "type": "string"
            },
            "geonameid": {
              "type": "integer"
            },
            "lat": {
              "type": "number"
            },
            "lon": {
              "type": "number"
            },
            "name": {
              "type": "string"
            },
            "population": {
              "type": "integer"
            },
            "timezone": {
              "type": "string"
            }
          }
        },
        "q": {
          "type": "string"
        }
      }
    },
    "initial_bearing_deg": {
      "type": "number"
    },
    "to": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "lon": {
          "type": "number"
        },
        "place": {
          "type": "object",
          "properties": {
            "admin1": {
              "type": "string"
            },
            "admin1_code": {
              "type": "string"
            },
            "admin2": {
              "type": "null"
            },
            "ascii_name": {
              "type": "string"
            },
            "country": {
              "type": "string"
            },
            "country_code": {
              "type": "string"
            },
            "elevation_m": {
              "type": "integer"
            },
            "feature": {
              "type": "string"
            },
            "feature_code": {
              "type": "string"
            },
            "geonameid": {
              "type": "integer"
            },
            "lat": {
              "type": "number"
            },
            "lon": {
              "type": "number"
            },
            "name": {
              "type": "string"
            },
            "population": {
              "type": "integer"
            },
            "timezone": {
              "type": "string"
            }
          }
        },
        "q": {
          "type": "string"
        }
      }
    }
  }
}
```

## Request example
Scenario: Official example · Live API.SH response · Minimal request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/geo/v1/distance?from=Paris%2C+FR&output=json&raw=0&to=Berlin%2C+DE' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "attribution": "Place data: GeoNames (geonames.org), CC BY 4.0",
  "cached": false,
  "credits_used": 1,
  "distance_km": 878.4,
  "distance_mi": 545.81,
  "distance_nmi": 474.3,
  "fetched_at": "2026-11-19T12:26:38.509Z",
  "from": {
    "lat": 48.85341,
    "lon": 2.3488,
    "place": {
      "admin1": "Île-de-France",
      "admin1_code": "11",
      "admin2": "Paris",
      "ascii_name": "Paris",
      "country": "France",
      "country_code": "FR",
      "elevation_m": 42,
      "feature": "capital",
      "feature_code": "PPLC",
      "geonameid": 2988507,
      "lat": 48.85341,
      "lon": 2.3488,
      "name": "Paris",
      "population": 2138551,
      "timezone": "Europe/Paris"
    },
    "q": "Paris, FR"
  },
  "initial_bearing_deg": 58.1,
  "to": {
    "lat": 52.52437,
    "lon": 13.41053,
    "place": {
      "admin1": "State of Berlin",
      "admin1_code": "16",
      "admin2": null,
      "ascii_name": "Berlin",
      "country": "Germany",
      "country_code": "DE",
      "elevation_m": 74,
      "feature": "capital",
      "feature_code": "PPLC",
      "geonameid": 2950159,
      "lat": 52.52437,
      "lon": 13.41053,
      "name": "Berlin",
      "population": 3426354,
      "timezone": "Europe/Berlin"
    },
    "q": "Berlin, DE"
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Available implementations
- apish: https://openany.si/market/apis/geo-data/geo-data-distance-between-two-places-api/?offering=05ffb3bb-886c-4fe4-8f18-ca26bf718cac

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
