返回首页
分时气象日出数据 GET 正常
06月19日 创建 更新于 07-01 22:26
传入省份、城市、天数、时段、日出日落参数,获取指定城市当日精细化天气、时段预报、日出日落信息。
总调用次数
126
接口地址
https://gulangsc.cn/API/weather/weather.php
请求示例
https://gulangsc.cn/API/weather/weather.php?place=泉州
参数说明
place string 查询城市
代码示例
curl -X GET 'https://gulangsc.cn/API/weather/weather.php?place=泉州'
import requests

url = 'https://gulangsc.cn/API/weather/weather.php?place=泉州'
response = requests.request('GET', url)
print(response.text)
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    url := "https://gulangsc.cn/API/weather/weather.php?place=泉州"
    req, _ := http.NewRequest("GET", url, nil)
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}
fetch('https://gulangsc.cn/API/weather/weather.php?place=泉州', {
  method: 'GET',
})
  .then(res => res.json())
  .then(console.log)
  .catch(console.error);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        var client = HttpClient.newHttpClient();
        var request = HttpRequest.newBuilder()
            .uri(URI.create("https://gulangsc.cn/API/weather/weather.php?place=泉州"))
            .method("GET", HttpRequest.BodyPublishers.noBody())
            .build();
        var response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
<?php
$url = 'https://gulangsc.cn/API/weather/weather.php?place=泉州';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
#!/bin/bash
# 使用 curl
curl -X GET 'https://gulangsc.cn/API/weather/weather.php?place=泉州'

# 或使用 wget
wget -qO- 'https://gulangsc.cn/API/weather/weather.php?place=泉州'
在线测试
查询城市
实时响应预览
正在获取实时响应...
元信息
API ID
#26
更新于
07-01 22:26
请求方式
GET
鉴权要求
无需 Key
QPS 状态
10/s
预览状态
已开启