PHPackages                             picamator/neo-ws-client - 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. picamator/neo-ws-client

AbandonedArchivedLibrary

picamator/neo-ws-client
=======================

Client for NASA Open Api: Near Earth Object Web Service

1.1.0(9y ago)722MITPHPPHP ~5.6|~7.0

Since Nov 26Pushed 9y ago2 watchersCompare

[ Source](https://github.com/picamator/NeoWsClient)[ Packagist](https://packagist.org/packages/picamator/neo-ws-client)[ RSS](/packages/picamator-neo-ws-client/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (9)Versions (5)Used By (0)

NeoWsClient
===========

[](#neowsclient)

[![PHP 7 ready](https://camo.githubusercontent.com/a43f191a894c91746f4496e474682b762a6bbd9b19cc0ddcc84c4ee676b539f9/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f706963616d61746f722f4e656f5773436c69656e742f6465762f62616467652e737667)](https://travis-ci.org/picamator/NeoWsClient)[![Latest Stable Version](https://camo.githubusercontent.com/7a311ff8f93724fef95950a4deb03d6f6933f5dd068c51bcd3ada17f3365de23/68747470733a2f2f706f7365722e707567782e6f72672f706963616d61746f722f6e656f2d77732d636c69656e742f762f737461626c652e737667)](https://packagist.org/packages/picamator/neo-ws-client)[![License](https://camo.githubusercontent.com/4622f56928027f00535dc19afbd063f6c242356a73676c15fa8d1d40b19d2ce0/68747470733a2f2f706f7365722e707567782e6f72672f706963616d61746f722f6e656f2d77732d636c69656e742f6c6963656e73652e737667)](https://packagist.org/packages/picamator/neo-ws-client)[![SensioLabsInsight](https://camo.githubusercontent.com/ed1773dc7f6074ca0069ced68e063d1a9b719b103d0ed718154b687e2baf9d13/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62336538666462362d383763662d343938382d383064612d3162386232316234353066322f6d696e692e706e67)](https://insight.sensiolabs.com/projects/b3e8fdb6-87cf-4988-80da-1b8b21b450f2)

Master
------

[](#master)

[![Build Status](https://camo.githubusercontent.com/a61499ec01701d240cd7bc3aad6a2f51767a43702467562d27d5cfc72ce7dd56/68747470733a2f2f7472617669732d63692e6f72672f706963616d61746f722f4e656f5773436c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/picamator/NeoWsClient)[![Coverage Status](https://camo.githubusercontent.com/3bde189f8b9179588ea0af9ebe3b427e0367e26a76cfac1b67787b81151b2e0f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f706963616d61746f722f4e656f5773436c69656e742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/picamator/NeoWsClient?branch=master)

Dev
---

[](#dev)

[![Build Status](https://camo.githubusercontent.com/5e8b133857abcc3a0a8e4b889527851ff1d95e07e43f0726d07f2921aea64ff3/68747470733a2f2f7472617669732d63692e6f72672f706963616d61746f722f4e656f5773436c69656e742e7376673f6272616e63683d646576)](https://travis-ci.org/picamator/NeoWsClient)[![Coverage Status](https://camo.githubusercontent.com/69d98b72233a9b1a1e8ba3ac8100eefd05de0d1bdb4128d9a91e658683a5de5d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f706963616d61746f722f4e656f5773436c69656e742f62616467652e7376673f6272616e63683d646576)](https://coveralls.io/github/picamator/NeoWsClient?branch=dev)

NeoWsClient - client for NASA Open Api "[Near Earth Object Web Service](https://api.nasa.gov/neo/?api_key=DEMO_KEY)" or NeoWs in short. All NeoWs data is from the [NASA JPL Asteroid team](http://neo.jpl.nasa.gov/).

NeoWsClient supports NeoWs v1 with resources:

- feed
- neo
- stats

Requirements
------------

[](#requirements)

- [PHP 5.6](http://php.net/manual/en/migration56.new-features.php) or [PHP 7.0](http://php.net/manual/en/migration70.new-features.php)

Installation
------------

[](#installation)

Update to your `composer.json` with:

```
{
    "require": {
        "picamator/neo-ws-client": "~1.0"
    }
}
```

Examples
--------

[](#examples)

To run examples please create `parameters.yml` in `config` directory using as a template [parameters.yml.dist](config/parameters.yml.dist). The `DEMO_KEY` is a valid api token. It has limitation as requests per hour, per day. More information in [NASA official documentation](https://api.nasa.gov/api.html#authentication).

Example list:

- Statistics: [GET /rest/v1/stats](doc/example/statistics.php)
- Neo: [GET /rest/v1/neo/{asteroid\_id}](doc/example/neo.php)
- Neo browse: [GET /rest/v1/neo/browse](doc/example/neo.browse.php)
- Feed: [GET /rest/v1/feed](doc/example/feed.php)
- Feed detailed: [GET /rest/v1/feed](doc/example/feed.detailed.php)
- Feed today: [GET /rest/v1/feed/today](doc/example/feed.today.php)
- Feed today detailed: [GET /rest/v1/feed/today](doc/example/feed.today.detailed.php)
- Wrong resource 404: [GET /rest/v1/wrong-resource](doc/example/wrong.resource.php)
- Wrong api token 403: [GET /rest/v1/wrong-resource](doc/example/wrong.api.key.php)
- Symfony 2.8 integration: [NeoWsExample](https://github.com/picamator/NeoWsExample)

Arbitrary precision math
------------------------

[](#arbitrary-precision-math)

NeoWsClient formats only Date to DateTime object all others keeps original API's. NeoWs uses string for long precision float like e.g. `.6304873017364636` execution `floatval` on them would removes last two digits. Therefore NeoWsClient does not convert strings to `int` or `float`. To make any math with `string floats` please use [BCMath](http://php.net/manual/en/book.bc.php). BCMath takes care of arbitrary precision mathematics.

Technical specification
-----------------------

[](#technical-specification)

That section describes extension and configuration points.

### Dependency injection

[](#dependency-injection)

NeoWsClient uses [Symfony DI](https://symfony.com/doc/current/components/dependency_injection.html). It's configuration in [services.yml](config/services.yml).

### Data mapping

[](#data-mapping)

NeoWsClient works with data mapping to create objects based on Api response. To make customization or build objects from API response it's need to create mapper repository object. Mapper repository object is a simple data storage over schema with implementation `Mapper\Api\RespositoryInterface`.

The schema contains:

NameIs requiredDescriptionsourceyesKey in API responsedestinationyesProperty inside NeoWsClient value objectdestinationContaineryesName of NeoWsClient object where `destination` property is locatedschemanoSub schemacollectionOfnoInterface name of NeoWsClient objects that will be present inside collection. It's an interface of `destinationContainer` in `sub-schema`.filternoName of NeoWsClient filter object, it runs over API's data### Errors

[](#errors)

There are three different error types:

- Response HTTP codes: 401, 403, 404
- Response HTTP code 200 with empty body
- Exception

#### Response HTTP codes: 401, 403, 404

[](#response-http-codes-401-403-404)

In case of getting HTTP codes: 401, 403, 404 or any unsuccessful one application return empty response. Empty response means valid `Response` object where:

- code: is a http code
- data: `stdClass` over body response string
- rateLimit: valid rate limit object with data if they are present in API's header

#### Response HTTP code 200 with empty body

[](#response-http-code-200-with-empty-body)

If API returns empty body with HTTP code 200 with several simultaneously requests. The NeoWsClient Manager rise exception `ManagerException` in that case. Because HTTP code 200 means OK, but body is wrong therefore NeoWsClient can not distinguish valid/invalid data by HTTP code.

That exception SHOULD be catch without putting any logic like resend, wait 3 sec. then resend again etc. Instead it's better to have cache over API.

#### Exception

[](#exception)

The full exception list that NeoWsClient rises is in [Exception](src/Exception) folder. If exception rise it means that application can not proceed request, it does not have any business logic in it.

Documentation
-------------

[](#documentation)

- UML class diagram: [class.diagram.png](doc/uml/class.diagram.png)
- Generated documentation: [phpdoc](doc/phpdoc), please build it following [instruction](dev/phpdoc)

Developing
----------

[](#developing)

To configure developing environment please:

1. Follow [Docker installation steps](dev/docker/README.md)
2. Run inside Docker container `composer install`

Contribution
------------

[](#contribution)

If you find this project worth to use please add a star. Follow changes to see all activities. And if you see room for improvement, proposals please feel free to create an issue or send pull request. Here is a great [guide to start contributing](https://guides.github.com/activities/contributing-to-open-source/).

Please note that this project is released with a [Contributor Code of Conduct](http://contributor-covenant.org/version/1/4/). By participating in this project and its community you agree to abide by those terms.

License
-------

[](#license)

NeoWsClient is licensed under the MIT License. Please see the [LICENSE](LICENSE.txt) file for details.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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 ~1 days

Total

3

Last Release

3451d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87835b8aad10c1a1fcdfb499cebd35ca4959255c148f452cde9ec3055d2ecb2c?d=identicon)[Sergii Pryz](/maintainers/Sergii%20Pryz)

---

Top Contributors

[![picamator](https://avatars.githubusercontent.com/u/4932996?v=4)](https://github.com/picamator "picamator (31 commits)")

---

Tags

clientearthNeoNASAJPLNeoWshazardousasteroid

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/picamator-neo-ws-client/health.svg)

```
[![Health](https://phpackages.com/badges/picamator-neo-ws-client/health.svg)](https://phpackages.com/packages/picamator-neo-ws-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

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