genius_api_unofficial 2.0.1 copy "genius_api_unofficial: ^2.0.1" to clipboard
genius_api_unofficial: ^2.0.1 copied to clipboard

This library provides you with a nice interface to Genius API.

Use Genius Lyrics API with ease #

This library provides you with a nice interface to Genius API. It's not an official Genius product.

All the available API documentation is copied and adapted into comments for you to see the usage of classes/methods right from an IDE.

All the API-related classes are prefixed with GeniusApi.

Classes #

Core classes #

  • GeniusApiOptions allows you to configure method calls.
  • GeniusApiTextFormat is the requested server response format.
  • GeniusApiResponse contains the response of a successful method call.
  • GeniusApiException will be thrown when http status code differs from 2xx.

Main API classes #

  • GeniusApiAuth allows you to get an accessToken, both on server or client.
  • GeniusApiRaw provides all the other officially documented methods.
  • GeniusApi is basic abstract API class that you can extend to write your own implementations.

Plans #

I'm planning to add some more Genius API implementations in the future (like GeniusApiRawExtended or GeniusApiWrapped).

There's what I think I will eventually add in new implementations:

For now the library only provides the comprehensive interface to Genius API through the GeniusApiRaw implementation, nothing more.

Usage #

Each method is documented fairly well and has pretty the same parameters, as listed in the official API doc.

You can find usage examples for each of them in tests folder.

A simple usage example:

final api = GeniusApiRaw(
  accessToken: 'token here',
// Set all methods to return plain text instead of the default dom format.
  defaultOptions: GeniusApiOptions(textFormat: GeniusApiTextFormat.plain),
);

// Get info about song "https://genius.com/Yxngxr1-riley-reid-lyrics".
final res = await api.getSong(4585202);
print(res.data!['song']['full_title']); // Outputs "Riley Reid by ​yxngxr1"

Further Reading #

Check out the API docs for detailed information about all package members.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

For folk seeing this on GitHub

4
likes
120
pub points
43%
popularity

Publisher

unverified uploader

This library provides you with a nice interface to Genius API.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (LICENSE)

Dependencies

enum_to_string, http, meta

More

Packages that depend on genius_api_unofficial