PHPackages                             allnewsapi/allnewsapi - 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. allnewsapi/allnewsapi

ActiveLibrary

allnewsapi/allnewsapi
=====================

PHP SDK for AllNewsAPI - a news aggregation REST API

00JavaCI passing

Since Aug 16Pushed todayCompare

[ Source](https://github.com/AllNewsAPI/sdks)[ Packagist](https://packagist.org/packages/allnewsapi/allnewsapi)[ RSS](/packages/allnewsapi-allnewsapi/feed)WikiDiscussions main Synced today

READMEChangelog (10)DependenciesVersions (1)Used By (0)

AllNewsAPI SDKs
===============

[](#allnewsapi-sdks)

[![CI](https://github.com/AllNewsAPI/allnewsapi-sdks/actions/workflows/ci.yml/badge.svg)](https://github.com/AllNewsAPI/allnewsapi-sdks/actions/workflows/ci.yml/badge.svg)

Official SDKs for the [AllNewsAPI](https://allnewsapi.com) — a news aggregation REST API providing search, headlines, and usage endpoints across 50,000+ sources worldwide.

Architecture
------------

[](#architecture)

This monorepo contains **6 language SDKs**, each providing a consistent interface to the AllNewsAPI:

SDKDirectoryPackagePython[`python-sdk/`](./python-sdk)`pip install allnewsapi`TypeScript[`javascript-sdk/`](./javascript-sdk)`npm install allnewsapi`Go[`go-sdk/`](./go-sdk)`go get github.com/AllNewsAPI/go-sdk`Java[`java-sdk/`](./java-sdk)Maven CentralPHP[`php-sdk/`](./php-sdk)`composer require allnewsapi/allnewsapi`Ruby[`ruby-sdk/`](./ruby-sdk)`gem install allnewsapi`All SDKs share the same design principles:

- Zero external dependencies (stdlib HTTP only)
- Three methods: `search`, `headlines`, `usage`
- Typed request/response interfaces
- Consistent error handling with status codes and messages

Quick Start
-----------

[](#quick-start)

### Python

[](#python)

```
pip install allnewsapi
```

```
from allnewsapi import NewsAPI

client = NewsAPI("your-api-key")
response = client.search(q="artificial intelligence", lang=["en"], max=10)

for article in response.articles:
    print(article.title)
```

### TypeScript

[](#typescript)

```
npm install allnewsapi
```

```
import { NewsAPI } from 'allnewsapi';

const client = new NewsAPI('your-api-key');
const response = await client.search({ q: 'artificial intelligence', lang: ['en'], max: 10 });

for (const article of response.articles) {
  console.log(article.title);
}
```

### Go

[](#go)

```
go get github.com/AllNewsAPI/go-sdk
```

```
package main

import (
    "fmt"
    newsapi "github.com/AllNewsAPI/go-sdk"
)

func main() {
    client := newsapi.NewClient("your-api-key")
    response, err := client.Search(newsapi.SearchOptions{
        Q:   "artificial intelligence",
        Lang: []string{"en"},
        Max:  10,
    })
    if err != nil {
        panic(err)
    }
    for _, article := range response.Articles {
        fmt.Println(article.Title)
    }
}
```

### Java

[](#java)

```

    com.allnewsapi
    allnewsapi
    0.1.0

```

```
import com.allnewsapi.NewsAPI;
import com.allnewsapi.SearchOptions;
import com.allnewsapi.SearchResponse;

NewsAPI client = new NewsAPI("your-api-key");
SearchResponse response = client.search(
    new SearchOptions.Builder()
        .q("artificial intelligence")
        .lang("en")
        .max(10)
        .build()
);

for (var article : response.getArticles()) {
    System.out.println(article.getTitle());
}
```

### PHP

[](#php)

```
composer require allnewsapi/allnewsapi
```

```
use AllNewsAPI\NewsAPI;

$client = new NewsAPI('your-api-key');
$response = $client->search([
    'q' => 'artificial intelligence',
    'lang' => ['en'],
    'max' => 10,
]);

foreach ($response['articles'] as $article) {
    echo $article['title'] . "\n";
}
```

### Ruby

[](#ruby)

```
gem install allnewsapi
```

```
require 'allnewsapi'

client = AllNewsAPI::Client.new('your-api-key')
response = client.search(q: 'artificial intelligence', lang: ['en'], max: 10)

response['articles'].each do |article|
  puts article['title']
end
```

Features
--------

[](#features)

- **Full API coverage** — search, headlines, and usage endpoints with all query parameters
- **Zero external dependencies** — each SDK uses only stdlib HTTP (urllib, fetch, net/http, HttpURLConnection, curl, net/http)
- **Typed interfaces** — dataclasses, TypeScript interfaces, Go structs, Java classes for IDE autocompletion
- **Automated releases** — Release-Please manages versioning and changelogs per SDK

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

[](#contributing)

See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup, commit conventions, and PR guidelines.

License
-------

[](#license)

MIT

###  Health Score

21

↑

LowBetter than 17% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 53.3% 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://www.gravatar.com/avatar/e2999e4af6eec826f5520a8e3b7b298a4c0fe35ad5ddb74e1454f446d1d414f1?d=identicon)[allnewsapi](/maintainers/allnewsapi)

---

Top Contributors

[![marvelefe](https://avatars.githubusercontent.com/u/56586020?v=4)](https://github.com/marvelefe "marvelefe (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")[![allnewsapi-release-bot[bot]](https://avatars.githubusercontent.com/u/209259044?v=4)](https://github.com/allnewsapi-release-bot[bot] "allnewsapi-release-bot[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/allnewsapi-allnewsapi/health.svg)

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

PHPackages © 2026

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