PHPackages                             langleyfoxall/press-association-tv-api-wrapper - 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. langleyfoxall/press-association-tv-api-wrapper

ActiveLibrary[API Development](/categories/api)

langleyfoxall/press-association-tv-api-wrapper
==============================================

📺⌚️ Provides access to information regarding TV channels, schedules and schedule items

v1.5.2(7y ago)15LGPL-3.0-onlyPHP

Since Jul 26Pushed 7y agoCompare

[ Source](https://github.com/langleyfoxall/press-association-tv-api-wrapper)[ Packagist](https://packagist.org/packages/langleyfoxall/press-association-tv-api-wrapper)[ RSS](/packages/langleyfoxall-press-association-tv-api-wrapper/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (4)Versions (15)Used By (0)

📺⌚️ Press Association TV API Wrapper
====================================

[](#️-press-association-tv-api-wrapper)

[![Packagist](https://camo.githubusercontent.com/36d47a4795517c733ab82aa1398b2fc3539f9232b8fe8b739ab90bb2931142cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c616e676c6579666f78616c6c2f70726573732d6173736f63696174696f6e2d74762d6170692d777261707065722e737667)](https://packagist.org/packages/langleyfoxall/press-association-tv-api-wrapper/stats)

This package provides a client for the [Press Association TV API](http://developer.press.net/).

It provides access to information regarding TV channels, schedules and schedule items.

> The Press Association (PA) is the national news agency for the UK and Ireland and a leading multimedia content provider across web, mobile, broadcast and print. For the last 145 years PA has been providing fast, accurate feeds of text, data, photos and video. Today the business is increasingly focused on the delivery of complete products for both digital and print clients.

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

[](#installation)

To install, just run the following Composer command from the root of your project.

```
composer require langleyfoxall/press-association-tv-api-wrapper
```

Usage
-----

[](#usage)

First instantiate the client using your API key.

```
$client = new \LangleyFoxall\PressAssociationTvApi\Client('API_KEY');
```

### Channels

[](#channels)

To retrieve details regarding a channel, call the `getChannel` method, passing it a channel ID. If you wish to retrieve details on multiple channels at once, you can call the `getChannels` method instead, passing it an array of channel IDs.

These methods will, respectively, return a `Channel` object or a collection of `Channel` objects.

You may wish to surround this method call with a try catch block to catch any networking exceptions.

```
$channel = $client->getChannel('da015cc7-a71e-3137-a110-30dc51262eef');

$channels = $client->getChannels([
    'da015cc7-a71e-3137-a110-30dc51262eef',
    '3b205a49-a866-32a0-b391-c727d52b1e79',
    '7cd38a6c-bb1f-306a-a6c6-00c7f7558432',
]);
```

#### Example `Channel` object

[](#example-channel-object)

The example below shows the available public properties that are available with a `Channel` object.

```
object(LangleyFoxall\PressAssociationTvApi\Objects\Channel)#1804 (2) {
  ["title"]=>
  string(20) "Sky Sports Action HD"
  ["images"]=>
  object(Illuminate\Support\Collection)#1803 (1) {
    ["items":protected]=>
    array(1) {
      [0]=>
      object(stdClass)#1800 (2) {
        ["kind"]=>
        string(12) "picture:logo"
        ["rendition"]=>
        object(stdClass)#1801 (3) {
          ["default"]=>
          object(stdClass)#1798 (1) {
            ["href"]=>
            string(43) "http://tv.static.press.net/logo/p329131.png"
          }
          ["transparent-light"]=>
          object(stdClass)#1794 (1) {
            ["href"]=>
            string(50) "http://tv.static.press.net/logo/p2201707181414.png"
          }
          ["transparent-dark"]=>
          object(stdClass)#1795 (1) {
            ["href"]=>
            string(50) "http://tv.static.press.net/logo/p1201707181414.png"
          }
        }
      }
    }
  }
}
```

### Schedules

[](#schedules)

You can retrieve the schedule for today by calling the `getScheduleForToday` method, passing it an array of channel IDs. Similarly, you can also retrieve the schedule for a specific day using the `getScheduleForDay` method, passing it an array of channel IDs and a `Carbon` date object.

Both of these method will return a `Schedule` object.

You may wish to surround this method call with a try catch block to catch any networking exceptions.

```
$schedule = $client->getScheduleForToday([
    'da015cc7-a71e-3137-a110-30dc51262eef',
    '3b205a49-a866-32a0-b391-c727d52b1e79',
    '7cd38a6c-bb1f-306a-a6c6-00c7f7558432',
]);

$tomorrowSchedule = $client->getScheduleForDay([
        'da015cc7-a71e-3137-a110-30dc51262eef',
        '3b205a49-a866-32a0-b391-c727d52b1e79',
        '7cd38a6c-bb1f-306a-a6c6-00c7f7558432',
    ], \Carbon\Carbon::now()->addDay());
```

You can then retrieve all schedule items, by calling the `Schedule` object's `all` method.

```
$items = $schedule->all();
```

Alternatively, you can retrieve schedule items filtered by genre, by calling the `Schedule` object's `getByGenre` method. This method accepts a genre or sport name, such as `Football`, `Tennis`, or `Boxing`.

```
$items = $schedule->getByGenre('Football');
```

#### Example `ScheduleItem` object

[](#example-scheduleitem-object)

The example below shows the available public properties that are available with a `ScheduleItem` object.

```
object(LangleyFoxall\PressAssociationTvApi\Objects\ScheduleItem)#1542 (5) {
  ["title"]=>
  string(27) "Hockey: China v Netherlands"
  ["episodeTitle"]=>
  string(27) "Hockey: China v Netherlands"
  ["dateTime"]=>
  object(Carbon\Carbon)#1538 (3) {
    ["date"]=>
    string(26) "2018-07-27 23:00:00.000000"
    ["timezone_type"]=>
    int(1)
    ["timezone"]=>
    string(6) "+00:00"
  }
  ["channel"]=>
  object(LangleyFoxall\PressAssociationTvApi\Objects\Channel)#1533 (2) {
    ["title"]=>
    string(10) "BT Sport 2"
    ["images"]=>
    object(Illuminate\Support\Collection)#1534 (1) {
      ["items":protected]=>
      array(1) {
        [0]=>
        object(stdClass)#1531 (2) {
          ["kind"]=>
          string(12) "picture:logo"
          ["rendition"]=>
          object(stdClass)#1532 (3) {
            ["default"]=>
            object(stdClass)#1529 (1) {
              ["href"]=>
              string(43) "http://tv.static.press.net/logo/p388708.png"
            }
            ["transparent-light"]=>
            object(stdClass)#1530 (1) {
              ["href"]=>
              string(50) "http://tv.static.press.net/logo/p2201805121806.png"
            }
            ["transparent-dark"]=>
            object(stdClass)#1506 (1) {
              ["href"]=>
              string(50) "http://tv.static.press.net/logo/p1201805121806.png"
            }
          }
        }
      }
    }
  }
  ["genres"]=>
  object(Illuminate\Support\Collection)#1535 (1) {
    ["items":protected]=>
    array(1) {
      [0]=>
      string(6) "hockey"
    }
  }
}
```

Limitations
-----------

[](#limitations)

This library does not currently deal with API pagination. This should not be a problem, as channels do not tend to have over 1000 schedule items per day.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 68.6% 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 ~9 days

Recently: every ~1 days

Total

14

Last Release

2722d ago

Major Versions

v1.5.1 → v15.2.x-dev2018-11-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

![](https://www.gravatar.com/avatar/250ad189b21ef862e3f0727fc0e416deb51588f7681ec35792327b1bd500e9ca?d=identicon)[langleyfoxall](/maintainers/langleyfoxall)

![](https://www.gravatar.com/avatar/fe494acbaf738dfb198cb8281a86065597bfb032317e3b111bb6f278b15ab727?d=identicon)[wheatleyjj](/maintainers/wheatleyjj)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (24 commits)")[![MaxHarrisonGit](https://avatars.githubusercontent.com/u/26774436?v=4)](https://github.com/MaxHarrisonGit "MaxHarrisonGit (10 commits)")[![yannickvidal](https://avatars.githubusercontent.com/u/33630265?v=4)](https://github.com/yannickvidal "yannickvidal (1 commits)")

---

Tags

newsphp-librarypress-associationschedulessporttelevisiontvtv-shows

### Embed Badge

![Health badge](/badges/langleyfoxall-press-association-tv-api-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/langleyfoxall-press-association-tv-api-wrapper/health.svg)](https://phpackages.com/packages/langleyfoxall-press-association-tv-api-wrapper)
```

###  Alternatives

[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[ashallendesign/laravel-exchange-rates

A wrapper package for interacting with the exchangeratesapi.io API.

485677.8k](/packages/ashallendesign-laravel-exchange-rates)[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[specialtactics/l5-api

Dependencies for the Laravel API Boilerplate package

3672.8k2](/packages/specialtactics-l5-api)

PHPackages © 2026

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