/openweathermap/weather
curl --request POST \
--url https://api.anysite.io/api/openweathermap/weather \
--header 'Content-Type: application/json' \
--header 'access-token: <api-key>' \
--data '
{
"lat": 0,
"lon": 0,
"timeout": 300,
"units": "metric"
}
'import requests
url = "https://api.anysite.io/api/openweathermap/weather"
payload = {
"lat": 0,
"lon": 0,
"timeout": 300,
"units": "metric"
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({lat: 0, lon: 0, timeout: 300, units: 'metric'})
};
fetch('https://api.anysite.io/api/openweathermap/weather', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anysite.io/api/openweathermap/weather",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lat' => 0,
'lon' => 0,
'timeout' => 300,
'units' => 'metric'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anysite.io/api/openweathermap/weather"
payload := strings.NewReader("{\n \"lat\": 0,\n \"lon\": 0,\n \"timeout\": 300,\n \"units\": \"metric\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.anysite.io/api/openweathermap/weather")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lat\": 0,\n \"lon\": 0,\n \"timeout\": 300,\n \"units\": \"metric\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anysite.io/api/openweathermap/weather")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lat\": 0,\n \"lon\": 0,\n \"timeout\": 300,\n \"units\": \"metric\"\n}"
response = http.request(request)
puts response.read_body[
{
"lat": 123,
"lon": 123,
"@type": "OpenweathermapWeather",
"timezone": "<string>",
"timezone_offset": 123,
"current": {
"@type": "OpenweathermapCurrent",
"observed_at": 123,
"sunrise": 123,
"sunset": 123,
"temp": 123,
"feels_like": 123,
"pressure": 123,
"humidity": 123,
"dew_point": 123,
"uvi": 123,
"clouds": 123,
"visibility": 123,
"wind_speed": 123,
"wind_deg": 123,
"wind_gust": 123,
"rain_1h": 123,
"snow_1h": 123,
"conditions": []
},
"minutely": [],
"hourly": [],
"daily": [],
"alerts": []
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}/openweathermap
/openweathermap/weather
Get current weather, minute precipitation, hourly and daily forecast, and alerts for a point
Price: 1 credit
POST
/
api
/
openweathermap
/
weather
/openweathermap/weather
curl --request POST \
--url https://api.anysite.io/api/openweathermap/weather \
--header 'Content-Type: application/json' \
--header 'access-token: <api-key>' \
--data '
{
"lat": 0,
"lon": 0,
"timeout": 300,
"units": "metric"
}
'import requests
url = "https://api.anysite.io/api/openweathermap/weather"
payload = {
"lat": 0,
"lon": 0,
"timeout": 300,
"units": "metric"
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({lat: 0, lon: 0, timeout: 300, units: 'metric'})
};
fetch('https://api.anysite.io/api/openweathermap/weather', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anysite.io/api/openweathermap/weather",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lat' => 0,
'lon' => 0,
'timeout' => 300,
'units' => 'metric'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anysite.io/api/openweathermap/weather"
payload := strings.NewReader("{\n \"lat\": 0,\n \"lon\": 0,\n \"timeout\": 300,\n \"units\": \"metric\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.anysite.io/api/openweathermap/weather")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lat\": 0,\n \"lon\": 0,\n \"timeout\": 300,\n \"units\": \"metric\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anysite.io/api/openweathermap/weather")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lat\": 0,\n \"lon\": 0,\n \"timeout\": 300,\n \"units\": \"metric\"\n}"
response = http.request(request)
puts response.read_body[
{
"lat": 123,
"lon": 123,
"@type": "OpenweathermapWeather",
"timezone": "<string>",
"timezone_offset": 123,
"current": {
"@type": "OpenweathermapCurrent",
"observed_at": 123,
"sunrise": 123,
"sunset": 123,
"temp": 123,
"feels_like": 123,
"pressure": 123,
"humidity": 123,
"dew_point": 123,
"uvi": 123,
"clouds": 123,
"visibility": 123,
"wind_speed": 123,
"wind_deg": 123,
"wind_gust": 123,
"rain_1h": 123,
"snow_1h": 123,
"conditions": []
},
"minutely": [],
"hourly": [],
"daily": [],
"alerts": []
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API token from the dashboard
Headers
Body
application/json
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I