PHPackages                             dmitry-ivanov/dark-sky-api - 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. [API Development](/categories/api)
4. /
5. dmitry-ivanov/dark-sky-api

AbandonedArchivedLibrary[API Development](/categories/api)

dmitry-ivanov/dark-sky-api
==========================

PHP Library for the Dark Sky API.

1.4.0(4y ago)6942.2k↓45%5MITPHPPHP &gt;=5.6

Since Jan 10Pushed 2y ago2 watchersCompare

[ Source](https://github.com/dmitry-ivanov/dark-sky-api)[ Packagist](https://packagist.org/packages/dmitry-ivanov/dark-sky-api)[ RSS](/packages/dmitry-ivanov-dark-sky-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (6)Versions (8)Used By (0)

[![PHP Library for the Dark Sky API](art/1380x575.png)](art/1380x575.png)

Dark Sky API
============

[](#dark-sky-api)

[![Buy me a coffee](https://user-images.githubusercontent.com/1286821/181085373-12eee197-187a-4438-90fe-571ac6d68900.png)](https://buymeacoffee.com/dmitry.ivanov)

[![StyleCI](https://camo.githubusercontent.com/9568b16b02574a62524b4119853b87522efd97d372509cdae3d40df5098c17a2/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3134383534333338322f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://github.styleci.io/repos/148543382?branch=master)[![Build Status](https://camo.githubusercontent.com/59abd969ed40bd1a4f0271e0d4e952b57cf1ea8cd2f28ac221b36a973a925c14/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f646d697472792d6976616e6f762f6461726b2d736b792d6170692f74657374732f6d6173746572)](https://github.com/dmitry-ivanov/dark-sky-api/actions?query=workflow%3Atests+branch%3Amaster)[![Coverage Status](https://camo.githubusercontent.com/e2c395fb9f869ea3f27ddeaa18737598440258a3dc3e3be5f4dec8cd924671f8/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f646d697472792d6976616e6f762f6461726b2d736b792d6170692f6d6173746572)](https://app.codecov.io/gh/dmitry-ivanov/dark-sky-api/branch/master)

[![Packagist Version](https://camo.githubusercontent.com/665b0b85956aca9275eb9a3f504d9af35ec477c384d03306e7a4c1c4d663f801/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646d697472792d6976616e6f762f6461726b2d736b792d617069)](https://camo.githubusercontent.com/665b0b85956aca9275eb9a3f504d9af35ec477c384d03306e7a4c1c4d663f801/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646d697472792d6976616e6f762f6461726b2d736b792d617069)[![Packagist Stars](https://camo.githubusercontent.com/4709e8f0373e3d0c0c74121dfe5a68d8f2ac89e905005be67d7f2bd3f388e8fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f646d697472792d6976616e6f762f6461726b2d736b792d617069)](https://camo.githubusercontent.com/4709e8f0373e3d0c0c74121dfe5a68d8f2ac89e905005be67d7f2bd3f388e8fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f646d697472792d6976616e6f762f6461726b2d736b792d617069)[![Packagist Downloads](https://camo.githubusercontent.com/0350247204c24bdd6b55ac90037b41b96a323263ad6620aa7c7363df72c651d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646d697472792d6976616e6f762f6461726b2d736b792d617069)](https://camo.githubusercontent.com/0350247204c24bdd6b55ac90037b41b96a323263ad6620aa7c7363df72c651d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646d697472792d6976616e6f762f6461726b2d736b792d617069)[![Packagist License](https://camo.githubusercontent.com/5017c3a6ed8c04b50dec9e412f11a4ca8fb48baafeafa8fb94099f4246b83986/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646d697472792d6976616e6f762f6461726b2d736b792d617069)](https://camo.githubusercontent.com/5017c3a6ed8c04b50dec9e412f11a4ca8fb48baafeafa8fb94099f4246b83986/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646d697472792d6976616e6f762f6461726b2d736b792d617069)

PHP Library for the [Dark Sky API](https://darksky.net/dev/docs).

[![Dark Sky API - Demo](doc/img/demo-b.gif)](doc/img/demo-b.gif)

Usage
-----

[](#usage)

1. Install the package via Composer:

    ```
    composer require dmitry-ivanov/dark-sky-api
    ```
2. Use the `DmitryIvanov\DarkSkyApi\DarkSkyApi` class:

    ```
    use DmitryIvanov\DarkSkyApi\DarkSkyApi;

    $forecast = (new DarkSkyApi('secret-key'))
        ->location(46.482, 30.723)
        ->forecast('daily');

    echo $forecast->daily()->summary();
    ```

Time Machine Requests
---------------------

[](#time-machine-requests)

Sometimes it might be useful to get weather for the specified date:

```
$timeMachine = (new DarkSkyApi('secret-key'))
    ->location(46.482, 30.723)
    ->timeMachine('2020-01-01', 'daily');

echo $timeMachine->daily()->summary();
```

You can also get weather for multiple dates:

```
$timeMachine = (new DarkSkyApi('secret-key'))
    ->location(46.482, 30.723)
    ->timeMachine(['2020-01-01', '2020-01-02', '2020-01-03'], 'daily');

echo $timeMachine['2020-01-02']->daily()->summary();
```

Usage in Laravel
----------------

[](#usage-in-laravel)

> If you're using Laravel &lt;5.5, you have to register service provider and alias by yourself!

1. Publish the config:

    ```
    php artisan vendor:publish --provider="DmitryIvanov\DarkSkyApi\Adapters\Laravel\DarkSkyApiServiceProvider"
    ```
2. Set your secret key in the `.env` file:

    ```
    DARK_SKY_KEY="Your-Secret-Key"
    ```
3. Use the `DarkSkyApi` facade:

    ```
    use DarkSkyApi;

    $forecast = DarkSkyApi::location(46.482, 30.723)
        ->forecast('daily');

    echo $forecast->daily()->summary();
    ```

Learn more
----------

[](#learn-more)

You can find more information in [my article](https://medium.com/@dmitry.g.ivanov/weather-forecast-in-php-95bca6b0ed18).

Sponsors
--------

[](#sponsors)

[![Laravel Idea](art/sponsor-laravel-idea.png)](https://laravel-idea.com)
[![Material Theme UI Plugin](art/sponsor-material-theme.png)](https://material-theme.com)

License
-------

[](#license)

Dark Sky API is open-sourced software licensed under the [MIT license](LICENSE.md).

[![Support on Patreon](https://raw.githubusercontent.com/dmitry-ivanov/dark-sky-api/master/art/support-on-patreon.png)](https://patreon.com/dmitryivanov) [![Buy me a coffee](https://user-images.githubusercontent.com/1286821/181085373-12eee197-187a-4438-90fe-571ac6d68900.png)](https://buymeacoffee.com/dmitry.ivanov)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~193 days

Recently: every ~209 days

Total

7

Last Release

1528d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.5.9

1.1.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b6a68d578b4021fbe05838e8e71ccd44b07879ffda6b7ec05c1deb65d0c88f8?d=identicon)[dmitry-ivanov](/maintainers/dmitry-ivanov)

---

Top Contributors

[![dmitry-ivanov](https://avatars.githubusercontent.com/u/1286821?v=4)](https://github.com/dmitry-ivanov "dmitry-ivanov (87 commits)")

---

Tags

apidark-skydark-sky-apidarkskydarksky-apiforecastlaravellaravel-packagephpweatherphpapilaravellaravel-packageweatherforecastdarkskydark-skydark-sky-apidarksky-api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dmitry-ivanov-dark-sky-api/health.svg)

```
[![Health](https://phpackages.com/badges/dmitry-ivanov-dark-sky-api/health.svg)](https://phpackages.com/packages/dmitry-ivanov-dark-sky-api)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162145.5k1](/packages/joisarjignesh-bigbluebutton)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)

PHPackages © 2026

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