# Weather API

**Weather API Documentation**

A Weather API is like a personal meteorologist, giving you real-time weather information for any location. You can use it to add weather features to websites, apps, or even smart home systems, keeping you informed about the climate and making your projects more interactive.

## **Base URL**

```
https://santechapi.vercel.app
```

### Authentication

```
headers : {
"token" : {YOUR API KEY}
}
```

**Endpoint :** `weather/location/{:q}`

### Parameters:

* {q}: Random location from the user

*HTTP Method: `Get`*

**Example request**

```
GET  Weather/location/chennai
```

Example Response

`200`

```
{
	"location": {
		"name": "Chennai",
		"region": "Tamil Nadu",
		"country": "India",
		"lat": 13.08,
		"lon": 80.28,
		"tz_id": "Asia/Kolkata",
		"localtime_epoch": 1727677610,
		"localtime": "2024-09-30 11:56"
	},
	"current": {
		"last_updated_epoch": 1727676900,
		"last_updated": "2024-09-30 11:45",
		"temp_c": 33.4,
		"temp_f": 92.1,
		"is_day": 1,
		"condition": {
			"text": "Partly cloudy",
			"icon": "//cdn.weatherapi.com/weather/64x64/day/116.png",
			"code": 1003
		},
		"wind_mph": 10.1,
		"wind_kph": 16.2,
		"wind_degree": 140,
		"wind_dir": "SE",
		"pressure_mb": 1011,
		"pressure_in": 29.85,
		"precip_mm": 0,
		"precip_in": 0,
		"humidity": 67,
		"cloud": 50,
		"feelslike_c": 41.7,
		"feelslike_f": 107,
		"windchill_c": 30.9,
		"windchill_f": 87.6,
		"heatindex_c": 35.6,
		"heatindex_f": 96,
		"dewpoint_c": 23.1,
		"dewpoint_f": 73.5,
		"vis_km": 6,
		"vis_miles": 3,
		"uv": 8,
		"gust_mph": 11.6,
		"gust_kph": 18.6
	}
}
```

### Error Handling

In case of an error, the API will respond with an appropriate HTTP status code and an error message in the response body.

`402`

```
 {
message: "param required for location based weather report"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://santech.gitbook.io/docs/weather-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
