PHPackages                             yorknouse/apple-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. [API Development](/categories/api)
4. /
5. yorknouse/apple-news-api

Abandoned → [chapter-three/apple-news-api](/?search=chapter-three%2Fapple-news-api)ArchivedLibrary[API Development](/categories/api)

yorknouse/apple-news-api
========================

Push content to Apple News.

0.4.1(5y ago)076MITPHPPHP &gt;=5.4.0

Since Jul 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/yorknouse/AppleNewsAPI)[ Packagist](https://packagist.org/packages/yorknouse/apple-news-api)[ Docs](https://github.com/yorknouse/AppleNewsAPI)[ RSS](/packages/yorknouse-apple-news-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (30)Used By (0)

AppleNewsAPI
============

[](#applenewsapi)

[![Travis CI build status](https://camo.githubusercontent.com/bd02c5fc4ae32ca32b59bfcb0e183045ddc6935d40ffebb581a1ea75bdcb5b01/68747470733a2f2f7472617669732d63692e6f72672f636861707465722d74687265652f4170706c654e6577734150492e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/chapter-three/AppleNewsAPI)

`AppleNewsAPI\PublisherAPI` is a PHP library that allows you to publish content to Apple News. You can also retrieve and delete articles you’ve already published, and get basic information about your channel and sections.

`AppleNewsAPI\Document` is a PHP library that helps construct documents in the [Apple News JSON format](https://developer.apple.com/library/ios/documentation/General/Conceptual/Apple_News_Format_Ref/).

[API Documentation](http://chapter-three.github.io/AppleNewsAPI/)

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

[](#installation)

```
composer require chapter-three/apple-news-api
```

or

```
git clone git@github.com:chapter-three/AppleNewsAPI.git
cd AppleNewsAPI
curl -sS https://getcomposer.org/installer | php
./composer.phar install
```

Document class Quick Start and Examples
---------------------------------------

[](#document-class-quick-start-and-examples)

```
use ChapterThree\AppleNewsAPI\Document;
use ChapterThree\AppleNewsAPI\Document\Components\Body;
use ChapterThree\AppleNewsAPI\Document\Layouts\Layout;
use ChapterThree\AppleNewsAPI\Document\Styles\ComponentTextStyle;

$obj = new Document(uniqid(), 'title', 'en', new Layout(7, 1024));
$obj->addComponent(new Body('body text'))
  ->addComponentTextStyle('default', new ComponentTextStyle());

$json = $obj->json();
```

PublisherAPI class Quick Start and Examples
-------------------------------------------

[](#publisherapi-class-quick-start-and-examples)

```
$api_key_id = "";
$api_key_secret = "";
$endpoint = "https://endpoint_url";

$PublisherAPI = new ChapterThree\AppleNewsAPI\PublisherAPI(
  $api_key_id,
  $api_key_secret,
  $endpoint
);
```

##### GET Channel

[](#get-channel)

```
// Fetches information about a channel.
$response = $PublisherAPI->get('/channels/{channel_id}',
  [
    'channel_id' => CHANNEL_ID
  ]
);
```

##### GET Sections

[](#get-sections)

```
// Fetches a list of all sections for a channel.
$response = $PublisherAPI->get('/channels/{channel_id}/sections',
  [
    'channel_id' => CHANNEL_ID
  ]
);
```

##### GET Section

[](#get-section)

```
// Fetches information about a single section.
$response = $PublisherAPI->get('/sections/{section_id}',
  [
    'section_id' => SECTION_ID
  ]
);
```

##### GET Article

[](#get-article)

```
// Fetches an article.
$response = $PublisherAPI->get('/articles/{article_id}',
  [
    'article_id' => ARTICLE_ID
  ]
);
```

##### POST Article

[](#post-article)

```
// Publishes a new article to a channel.
// $response contains an article ID and revision ID.
$response = $PublisherAPI->post('/channels/{channel_id}/articles',
  [
    'channel_id' => CHANNEL_ID
  ],
  [
    // List of files to POST
    'files' => [], // optional. A list of article assets [uri => path]
    // JSON metadata string
    'metadata' => $metadata, // required
    'json' => '', // required. Apple News Native formatted JSON string.
  ]
);
```

##### UPDATE Article

[](#update-article)

```
// Metadata information `revision` is required.
$metadata = json_encode([
  'data' => [
    'revision' => REVISION_ID
  ]
]);
// Updates an existing article.
// See $response variable to get a new revision ID.
$response = $PublisherAPI->post('/articles/{article_id}',
  [
    'article_id' => ARTICLE_ID
  ],
  [
    // List of files to POST
    'files' => [], // optional. A list of article assets [uri => path]
    // JSON metadata string
    'metadata' => $metadata, // required
    // Apple News Native formatted JSON string. See examples.
    'json' => '', // required.
  ]
);
```

##### DELETE Article

[](#delete-article)

```
// Deletes an article.
$response = $PublisherAPI->delete('/articles/{article_id}',
  [
    'article_id' => ARTICLE_ID
  ]
);
```

Contribute
----------

[](#contribute)

### Run Unit Tests

[](#run-unit-tests)

```
./vendor/bin/phpunit -v --colors=auto --bootstrap vendor/autoload.php tests
```

To test PublisherAPI GET/POST/DELETE methods use the following pattern:

```
./vendor/bin/phpunit -v --colors=auto --bootstrap vendor/autoload.php
tests/PublisherAPITest.php [API_KEY] [API_SECRET] [ENDPOINT_URL] [METHOD] [ENDPOINT_PATH]
```

### Generate PHPDoc

[](#generate-phpdoc)

```
git clone --branch gh-pages git@github.com:chapter-three/AppleNewsAPI.git ../AppleNewsAPI_phpdoc
./vendor/bin/phpdoc run --title='chapter-three/apple-news-api v'$(cat composer.json | jq -r '.version') -d ./ -i vendor/,tests/ -t ../AppleNewsAPI_phpdoc
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.7% 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 ~71 days

Recently: every ~482 days

Total

29

Last Release

1948d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/68cca03f1a580ae4b88ddb9767e146b73b17b9655853fee8bb815d7429bc650c?d=identicon)[bithell](/maintainers/bithell)

---

Top Contributors

[![minnur](https://avatars.githubusercontent.com/u/4031934?v=4)](https://github.com/minnur "minnur (178 commits)")[![tbfisher](https://avatars.githubusercontent.com/u/252251?v=4)](https://github.com/tbfisher "tbfisher (68 commits)")[![Jbithell](https://avatars.githubusercontent.com/u/8408967?v=4)](https://github.com/Jbithell "Jbithell (5 commits)")[![m4olivei](https://avatars.githubusercontent.com/u/191049?v=4)](https://github.com/m4olivei "m4olivei (5 commits)")[![moonray](https://avatars.githubusercontent.com/u/281245?v=4)](https://github.com/moonray "moonray (4 commits)")[![scottfalkingham](https://avatars.githubusercontent.com/u/151304?v=4)](https://github.com/scottfalkingham "scottfalkingham (3 commits)")

---

Tags

apipushapple news

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[chapter-three/apple-news-api

Push content to Apple News.

38307.5k3](/packages/chapter-three-apple-news-api)[norkunas/onesignal-php-api

OneSignal API for PHP

2441.8M21](/packages/norkunas-onesignal-php-api)[pubnub/pubnub

This is the official PubNub PHP SDK repository.

1314.6M17](/packages/pubnub-pubnub)[serpwow/google-search-results

Google Search Results PHP package via SerpWow.com

1931.8k1](/packages/serpwow-google-search-results)[dariusiii/php-itunes-api

Query iTunes API System

1116.9k](/packages/dariusiii-php-itunes-api)

PHPackages © 2026

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