# getLocationCoordinates

**Identifier:** `openweather_getLocationCoordinates`

**Provider:** [OpenWeather](https://kirha.com/providers/openweather.md)

Search for geographic coordinates and location details by city name or ZIP code. Returns latitude and longitude for use with other weather tools.

## Run it with the CLI

```bash
kirha tools run openweather_getLocationCoordinates \
  --input '{}'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "openweather_getLocationCoordinates",
  "input": {}
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "properties": {
        "cityName": {
          "description": "City name (e.g., 'London', 'Paris', 'New York')",
          "type": "string"
        },
        "countryCode": {
          "description": "ISO 3166 country code (e.g., 'US', 'UK', 'FR')",
          "type": "string"
        },
        "stateCode": {
          "description": "State code for US cities (e.g., 'NY', 'CA')",
          "type": "string"
        },
        "zipCode": {
          "not": {}
        }
      },
      "required": [
        "cityName"
      ],
      "type": "object"
    },
    {
      "properties": {
        "cityName": {
          "not": {}
        },
        "countryCode": {
          "description": "ISO 3166 country code (required with ZIP code, e.g., 'GB', 'US')",
          "type": "string"
        },
        "stateCode": {
          "not": {}
        },
        "zipCode": {
          "description": "ZIP/postal code (e.g., 'E14' or 'E14 5EP')",
          "type": "string"
        }
      },
      "required": [
        "zipCode",
        "countryCode"
      ],
      "type": "object"
    }
  ]
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "locations": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "country": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lon": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "lat",
          "lon",
          "country"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "locations"
  ],
  "type": "object"
}
```

-----

[All OpenWeather tools](https://kirha.com/providers/openweather.md) · [< Back to tools list](https://kirha.com/tools.md)