Skip to content

omnisong/odesli API reference

Floor
Provider · Omnisong
Version
1.x
Conformance suite
not wired
Verified for real
Its README does not say
Licence
MIT
composer require omnisong/odesli:1.x-dev

Read from the package's own PHP files at the commit 04c7181c01a8: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.

Omnisong\Odesli

  • OdesliCatalog class

    song.link's API (v1-alpha.1): given a URL on any platform, or a platform's own id, the same song or album everywhere else. It knows where a recording is, not what is on it: no tracks, no previews, no list of an artist's releases - and it reads neither a UPC nor an ISRC (the aggregator comes back with the id another catalogue found).

    5 methods · 1 constant

  • OdesliCatalogFactory class

    Odesli (song.link): one link to the same song or album on every platform.

    3 options

Omnisong\Odesli

OdesliCatalog class

final class OdesliCatalog implements CatalogInterface OdesliCatalog.php:26

song.link's API (v1-alpha.1): given a URL on any platform, or a platform's own id, the same song or album everywhere else. It knows where a recording is, not what is on it: no tracks, no previews, no list of an artist's releases - and it reads neither a UPC nor an ISRC (the aggregator comes back with the id another catalogue found).

const BASE_URI = 'https://api.song.link/v1-alpha.1/'

OdesliCatalog::__construct()

public function __construct(readonly HttpClientInterface $http, readonly ?string $apiKey = null, readonly ?string $country = null, readonly string $baseUri = self::BASE_URI)

OdesliCatalog::getName()

public function getName(): string
public function links(Reference $reference): PlatformLinks

OdesliCatalog::release()

public function release(Reference $reference): ?Release

OdesliCatalog::releases()

public function releases(string $artist, int $limit = 50, ?string $country = null): array

OdesliCatalogFactory class

final class OdesliCatalogFactory extends CatalogFactory OdesliCatalogFactory.php:18

Odesli (song.link): one link to the same song or album on every platform.

options: api_key: '%env(default::ODESLI_API_KEY)%' # from developers@song.link; without one the API answers 401 since the public access was withdrawn country: 'DE' # userCountry: the store the links point at (default: Odesli's, US) base_uri: 'https://api.song.link/v1-alpha.1/'

Options

OptionDefault
api_keynull
countrynull
base_uriOdesliCatalog::BASE_URI