PHPackages                             nwidart/forecast-php - 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. nwidart/forecast-php

ActiveLibrary

nwidart/forecast-php
====================

PHP client package for the Forecast.io service

1.0.0(10y ago)31.3k1[1 issues](https://github.com/nWidart/forecast-php/issues)1MITPHPPHP &gt;=5.5.0

Since Aug 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/nWidart/forecast-php)[ Packagist](https://packagist.org/packages/nwidart/forecast-php)[ Docs](https://github.com/nWidart/forecast-php)[ RSS](/packages/nwidart-forecast-php/feed)WikiDiscussions master Synced 1mo ago

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

Forecast PHP
============

[](#forecast-php)

[![Latest Version](https://camo.githubusercontent.com/b84dbe9047f00e2802be792771054ab811f7bd4b8835e15f0020811ccc97031e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e7769646172742f666f7265636173742d7068702e7376673f7374796c653d666c61742d737175617265)](https://github.com/nwidart/forecast-php/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/a948f5db96e809f8d41d26f79aa0d542a6d290986e0360d936692270c5bb90bc/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e5769646172742f666f7265636173742d7068702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/nWidart/forecast-php)[![Coverage Status](https://camo.githubusercontent.com/1d587b6c833080ca3408a1383f78a900f6b59fada2410c0bf30b0013edfb51c4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6e5769646172742f666f7265636173742d7068702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/nWidart/forecast-php/code-structure)[![Quality Score](https://camo.githubusercontent.com/6f2faba27438b8ba7d3ec46dcd7ef4832f2ba9e960ce6ae84aafb4c62f04dd27/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6e5769646172742f666f7265636173742d7068702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/nWidart/forecast-php)[![SensioLabs Insight](https://camo.githubusercontent.com/07984053e11a09f7ea5e570568a738ed8630cdb3fce2cb81f041cfebf2906705/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f30373230333761382d633464302d346566382d616439642d3765646364616561343631392e737667)](https://insight.sensiolabs.com/projects/072037a8-c4d0-4ef8-ad9d-7edcdaea4619)[![Total Downloads](https://camo.githubusercontent.com/866407fda5f471669735252a558c3c34db8917380945af43e9b54e3909dab992/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e7769646172742f666f7265636173742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nwidart/forecast-php)

A PHP client package for the [Forecast.io](https://forecast.io/) [API](https://developer.forecast.io/).

Want to use this inside a Laravel application? Check out the [Laravel-Forecast](https://github.com/nWidart/Laravel-forecast) package.

Install
-------

[](#install)

Via Composer

```
$ composer require nwidart/forecast-php
```

Usage
-----

[](#usage)

```
$forecast = new \Nwidart\ForecastPhp\Forecast('your_api_key');

// Simple latitude and longitude
$info = $forecast->get('40.7324296', '-73.9977264');

// Fetch weather at a given time
$info = $forecastPhp->get('40.7324296', '-73.9977264', '2013-05-06T12:00:00-0400');

// Add options to the request
$info = $forecastPhp->setOptions(['units' => 'si',])->get('40.7324296', '-73.9977264');
```

For more details and all available options check the [official documentation](https://developer.forecast.io/docs/v2).

An example response:

```
{
  "latitude": 40.7324296,
  "longitude": -73.9977264,
  "timezone": "America/New_York",
  "offset": -4,
  "currently": {
    "time": 1438445386,
    "summary": "Partly Cloudy",
    "icon": "partly-cloudy-day",
    "nearestStormDistance": 63,
    "nearestStormBearing": 360,
    "precipIntensity": 0,
    "precipProbability": 0,
    "temperature": 84.71,
    "apparentTemperature": 85.39,
    "dewPoint": 62.25,
    "humidity": 0.47,
    "windSpeed": 7.95,
    "visibility": 10,
    "cloudCover": 0.59,
    "pressure": 1010.33,
    "ozone": 323.24
  },
  "minutely": {
    ...
  },
  "hourly": {
    ...
  },
  "daily": {
    ...
  },
  "flags": {
    ...
  },
  "headers": {
    ...
  }
}
```

Testing
-------

[](#testing)

```
$ phpunit
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Nicolas Widart](https://github.com/nWidart)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

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

3942d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/565946b8d70f5fa172a21f87b7f0e3abdce0611cc1cd300ec8e7b360bdb0a4bc?d=identicon)[nWidart](/maintainers/nWidart)

---

Top Contributors

[![nWidart](https://avatars.githubusercontent.com/u/882397?v=4)](https://github.com/nWidart "nWidart (23 commits)")

---

Tags

phpweatherforecastforecast.io

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nwidart-forecast-php/health.svg)

```
[![Health](https://phpackages.com/badges/nwidart-forecast-php/health.svg)](https://phpackages.com/packages/nwidart-forecast-php)
```

###  Alternatives

[guhelski/forecast-php

Drop dead simple Dark Sky API wrapper in PHP

42143.8k](/packages/guhelski-forecast-php)[rugaard/weatherkit

Integrate Apple WeatherKit API into your project

111.4k](/packages/rugaard-weatherkit)

PHPackages © 2026

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