PHPackages                             ndolestudio/darksky-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. [API Development](/categories/api)
4. /
5. ndolestudio/darksky-php

ActiveLibrary[API Development](/categories/api)

ndolestudio/darksky-php
=======================

A PHP Wrapper for the Dark Sky Weather API

1.0.0(7y ago)28MITPHPPHP ^7.0CI failing

Since Oct 9Pushed 7y agoCompare

[ Source](https://github.com/NdoleStudio/darksky-php)[ Packagist](https://packagist.org/packages/ndolestudio/darksky-php)[ RSS](/packages/ndolestudio-darksky-php/feed)WikiDiscussions master Synced yesterday

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

Dark Sky PHP
============

[](#dark-sky-php)

This is a PHP wrapper for the official Dark Sky API found at

[![Latest Stable Version](https://camo.githubusercontent.com/9f26a3d981e39c3ddb10e1c6d068eaa2736d7a0495b38701d47c8104dec82690/68747470733a2f2f706f7365722e707567782e6f72672f6e646f6c6573747564696f2f6461726b736b792d7068702f762f737461626c65)](https://packagist.org/packages/ndolestudio/darksky-php)[![Build Status](https://camo.githubusercontent.com/0929e65e6acef01a24222d9edc1914644904fe5a4f1d5b42767ff1bf756fc1fc/68747470733a2f2f7472617669732d63692e6f72672f4e646f6c6553747564696f2f6461726b73792d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/NdoleStudio/darksy-php)[![Packagist](https://camo.githubusercontent.com/fd816f3a28cb25432b03a83b361c1910bb7d61a9cc193ec4b9504fda569c3008/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e646f6c6573747564696f2f6461726b736b792d7068702e737667)](https://packagist.org/packages/ndolestudio/darksky-php)[![GitHub license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/NdoleStudio/darksky-php/master/LICENSE)

Getting Started
---------------

[](#getting-started)

These instructions will guide you on how to install and use this package to get weather information using the Dark Sky API.

### Prerequisites

[](#prerequisites)

This package works with PHP 7. So your php version must be greater `7.0` or later.

### Installing

[](#installing)

This package can be installed easily using composer.

```
composer install ndolestudio/darksky-php

```

Example
-------

[](#example)

Create a class which implements the `LocationDateTimeInput` interface. This class would be used as an input in the `DarkSkyApiClient`

```
class Request implements \DarkSky\Contracts\LocationDateTimeInput
{
    public function getLatitude(): float
    {
        return 33.22;
    }

    public function getLongitude(): float
    {
        return 24.44;
    }

    public function getDateTime(): DateTime
    {
        return new DateTime('now');
    }
}
```

Use the `LocationDateTimeInput` class created above to fetch the weather data using the `DarkSkyApiClient`

```
// Require composer dependencies.
require './vendor/autoload.php';

// Here, we create a DarkSkyApiConfiguration
$apiConfiguration = new \DarkSky\Configurations\DarkSkyApiConfiguration(
    ['daily','currently'], // Excluded blocks
    'https://api.darksky.net/forecast/b95b5555fb5f8e94cf499f4036618e55/', // Api Endpoint
    'si' // Units
);

// Use the configuration to create a DarkSkyApiClient
$darkSkyApiClient = new \DarkSky\Clients\DarkSkyApiClient($apiConfiguration, new \GuzzleHttp\Client());

// Create an instance of the LocationDateTimeInput
$request = new Request();

// This fetches the json response
$jsonResponse = $darkSkyApiClient->fetchWeatherData($request);
```

Running the tests
-----------------

[](#running-the-tests)

The tests can be run using `PHPUnit`. The steps to run the tests are listed below

After cloning this repository, download dependencies with composer

```
composer install

```

The step above will install `PHPUnit` which you can run using the command below

```
./vendor/bin/phpunit

```

Built With
----------

[](#built-with)

- [Guzzle](http://www.dropwizard.io/1.0.2/docs/) - The extensible PHP HTTP client

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

[](#contributing)

Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).

Authors
-------

[](#authors)

- **[AchoArnold](https://github.com/AchoArnold)**

See also the list of [contributors](https://github.com/NdoleStudio/darksky-php/contributors) who participated in this project.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

2773d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13936519?v=4)[Ndole Studio](/maintainers/ndolestudio)[@NdoleStudio](https://github.com/NdoleStudio)

---

Top Contributors

[![AchoArnold](https://avatars.githubusercontent.com/u/4196457?v=4)](https://github.com/AchoArnold "AchoArnold (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ndolestudio-darksky-php/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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