PHPackages                             n8davis/news-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. n8davis/news-api

ActiveProject

n8davis/news-api
================

Basic wrapper for News API

06PHP

Since Aug 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/n8davis/news-api)[ Packagist](https://packagist.org/packages/n8davis/news-api)[ RSS](/packages/n8davis-news-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Simple News API Wrapper
-----------------------

[](#simple-news-api-wrapper)

#### Installation

[](#installation)

```
composer create-project n8davis/news-api

```

#### Get Sources

[](#get-sources)

```
$news    = new News( 'YOUR_NEWS_API_KEY' );
$sources = $news->get_sources([
    'country'  => 'us' ,
    'language' => 'en'
 ]);

```

#### Get Everything

[](#get-everything)

```
$news       = new News( 'YOUR_NEWS_API_KEY' );
$everything = $news->get_everything([
    'q'        => 'bitcoin',
    'sources'  => 'bbc-news,the-verge',
    'domains'  => 'bbc.co.uk,techcrunch.com',
    'from'     => '2017-12-01',
    'to'       => '2017-12-12',
    'language' => 'en',
    'sortBy'   => 'relevancy',
    'page'     => 2
 ]);

```

#### Get Top Headlines

[](#get-top-headlines)

```
$news         = new News( 'YOUR_NEWS_API_KEY' );
$topHeadlines = $news->get_top_headlines([
    'q'        => 'bitcoin',
    'sources'  => 'bbc-news,the-verge',
    'category' => 'business',
    'country'  => 'us' ,
    'language' => 'en'
 ]);

```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15928935?v=4)[Nate Davis](/maintainers/n8davis)[@n8davis](https://github.com/n8davis)

---

Top Contributors

[![n8davis](https://avatars.githubusercontent.com/u/15928935?v=4)](https://github.com/n8davis "n8davis (19 commits)")

### Embed Badge

![Health badge](/badges/n8davis-news-api/health.svg)

```
[![Health](https://phpackages.com/badges/n8davis-news-api/health.svg)](https://phpackages.com/packages/n8davis-news-api)
```

PHPackages © 2026

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