PHPackages                             godquan/weather - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. godquan/weather

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

godquan/weather
===============

A weather SDK.

0.0.1(4y ago)03MITPHP

Since Jul 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/QuanGod/weather)[ Packagist](https://packagist.org/packages/godquan/weather)[ RSS](/packages/godquan-weather/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

 weather
=========

[](#-weather-)

 基于 高德开放平台 的 PHP 天气信息组件.

Installing
----------

[](#installing)

```
$ composer require godquan/weather -vvv
```

\##配置 在使用本扩展之前，你需要去 高德开放平台 注册账号，然后创建应用，获取应用的 API Key。

Usage
-----

[](#usage)

use GodQuan\\weather\\weather;

$key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx';

$weather = new Weather($key);

\##获取实时天气 $response = $weather-&gt;getWeather('城市名');

\##获取近期天气预报 $response = $weather-&gt;getWeather('城市名', 'all');

\##参数说明 array|string getWeather(string $city, string $type = 'base', string $format = 'json')

$city - 城市名，比如：“深圳”；

$type - 返回内容类型：base: 返回实况天气 / all: 返回预报天气；

$format - 输出的数据格式，默认为 json 格式，当 output 设置为 “xml” 时，输出的为 XML 格式的数据。

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/godquan/weather/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/godquan/weather/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

BY GodQuan

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1781d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7cbd83f4a01186de9a21bd586b612d8d75613f4cceb7b20f7145f6b11ace05d?d=identicon)[QuanGod](/maintainers/QuanGod)

---

Top Contributors

[![tan9514](https://avatars.githubusercontent.com/u/28286659?v=4)](https://github.com/tan9514 "tan9514 (1 commits)")

### Embed Badge

![Health badge](/badges/godquan-weather/health.svg)

```
[![Health](https://phpackages.com/badges/godquan-weather/health.svg)](https://phpackages.com/packages/godquan-weather)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
