PHPackages                             sockstack/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. sockstack/weather

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

sockstack/weather
=================

A weather SDK.

0.0.1(7y ago)09MITPHP

Since Oct 31Pushed 7y agoCompare

[ Source](https://github.com/sockstack/weather-sdk-for-free)[ Packagist](https://packagist.org/packages/sockstack/weather)[ RSS](/packages/sockstack-weather/feed)WikiDiscussions master Synced 3d ago

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

 weather
=========

[](#-weather-)

[![Build Status](https://camo.githubusercontent.com/0ecfaf8d7500f4d0e5b94864e85b31d8c42fe3856037175d4783469a46592599/68747470733a2f2f7777772e7472617669732d63692e6f72672f736f636b737461636b2f776561746865722d73646b2d666f722d667265652e7376673f6272616e63683d6d6173746572)](https://www.travis-ci.org/sockstack/weather-sdk-for-free)[![StyleCI](https://camo.githubusercontent.com/80ee36b9ee1f4fa8d41beefb8b75b0d112da32d0beaf924a7a15751c3aa1deb5/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3135353532393936392f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/155529969)[![codecov](https://camo.githubusercontent.com/b3675b8bcf57921ed2bb2c57df4fbac155b3bb0389298cd70132cf116ae1240b/68747470733a2f2f636f6465636f762e696f2f67682f736f636b737461636b2f776561746865722d73646b2d666f722d667265652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/sockstack/weather-sdk-for-free)

Notice
------

[](#notice)

这是一个测试案例，不可用于生产环境。

Installing
----------

[](#installing)

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

Usage
-----

[](#usage)

```
use Sockstack\Weather\Weather;

$weather = new Weather();
//json
$response = $weather->get("北京市");

//array
$response = $weather->get("北京市", true);
```

Response
--------

[](#response)

> json:

```
{
    "data": {
        "yesterday": {
            "date": "30日星期二",
            "high": "高温 16℃",
            "fx": "北风",
            "low": "低温 1℃",
            "fl": "",
            "type": "晴"
        },
        "city": "北京",
        "aqi": "29",
        "forecast": [
            {
                "date": "31日星期三",
                "high": "高温 17℃",
                "fengli": "",
                "low": "低温 3℃",
                "fengxiang": "西南风",
                "type": "晴"
            },
            {
                "date": "1日星期四",
                "high": "高温 17℃",
                "fengli": "",
                "low": "低温 3℃",
                "fengxiang": "南风",
                "type": "晴"
            },
            {
                "date": "2日星期五",
                "high": "高温 18℃",
                "fengli": "",
                "low": "低温 5℃",
                "fengxiang": "南风",
                "type": "晴"
            },
            {
                "date": "3日星期六",
                "high": "高温 17℃",
                "fengli": "",
                "low": "低温 7℃",
                "fengxiang": "南风",
                "type": "多云"
            },
            {
                "date": "4日星期天",
                "high": "高温 14℃",
                "fengli": "",
                "low": "低温 6℃",
                "fengxiang": "北风",
                "type": "多云"
            }
        ],
        "ganmao": "天凉，昼夜温差较大，较易发生感冒，请适当增减衣服，体质较弱的朋友请注意适当防护。",
        "wendu": "15"
    },
    "status": 1000,
    "desc": "OK"
}
```

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

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/sockstack/weather/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/sockstack/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)

MIT

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.8% 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

2753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bc7ea85421d6f66ad1e07f3eaf5b64b5ada5f7568f4deef02af9b5bbb4bc3ce?d=identicon)[sockstack](/maintainers/sockstack)

---

Top Contributors

[![sockstack](https://avatars.githubusercontent.com/u/44636592?v=4)](https://github.com/sockstack "sockstack (10 commits)")[![623466433](https://avatars.githubusercontent.com/u/24764256?v=4)](https://github.com/623466433 "623466433 (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/sockstack-weather/health.svg)](https://phpackages.com/packages/sockstack-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)
