Download the PHP package radioapi/php without Composer

On this page you can find all versions of the php package radioapi/php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php

RadioAPI PHP SDK

A small PHP client for RadioAPI. It covers station management, public and private Now Playing requests, and Stream Router routes.

Install

The package requires PHP 8.2+ and ext-json. It uses Guzzle's ClientInterface, so you can inject your own configured HTTP client.

To publish it, release the contents of this package/ directory as the radioapi/php repository, tag a version such as v1.0.0, and submit that repository to Packagist. Composer will then resolve the command above.

Start here

Create a client with an API key for the Management API. Pass the root URL of your RadioAPI app, without /api/v1.

The base URL comes first so the simplest setup is also clear when using positional arguments:

Inject a configured Guzzle client only when you need custom middleware, retries, timeouts, or a test client:

For public Now Playing, use a client without an API key and the same API base URL:

Stations

The supported stream metadata providers are jcplayer (generic/ICY), azuracast, radioking, and live365. AzuraCast, RadioKing, and Live365 require stream_metadata_settings.url.

list() returns the API pagination object with data, links, and meta. create(), find(), and update() return the unwrapped resource from data.

Now Playing

Use the same authenticated client for a private station. Public stations do not need an API key:

Now Playing returns a top-level metadata object. The upstream stream field is never exposed. The payload can include name, bitrate, format, artist, song, album, genre, artwork, year, duration, elapsed, remaining, time, lyrics, explicit, songFound, and metadataFound.

When Track History is enabled for the station and the provider has history available, the response also has a history array. Treat provider metadata as optional: an unavailable field is usually an empty string or zero value.

Stream Router

Create a public route that follows a station’s current stream URL:

Or route straight to an external stream without a station:

Use exactly one of station_uuid or target_url when creating or changing a route. Valid redirect_status_code values are 302 and 307.

Errors

All non-2xx responses throw RadioApi\Exceptions\ApiException. It carries the HTTP status, RadioAPI error code, response payload, and response headers.

Malformed or empty JSON responses throw RadioApi\Exceptions\InvalidResponseException. Network failures throw RadioApi\Exceptions\TransportException with the original Guzzle exception attached as the previous exception.

Test the package

License

MIT. See LICENSE.


All versions of php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
guzzlehttp/guzzle Version ^7.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package radioapi/php contains the following files

Loading the files please wait ...