Crystalize is a Crystal shard that adds support for the Spotify API. It is usable, but doesn't cover most of the API and may not have a stable interface.
Crystalize alternatives and similar shards
Based on the "Third-party APIs" category.
Alternatively, view Crystalize alternatives based on common mentions on social networks and blogs.
Do you think we are missing an alternative of Crystalize or a related project?
Crystalize is a Crystal library that adds support for the Spotify API.
Crystalize is still a WIP. It is usable, but doesn't cover all of the API and may not have a stable interface.
- Add the dependency to your
dependencies: crystalize: github: t1ra/crystalize
To use Crystalize, you first have to set credentials:
Crystalize.authenticate(id: "your-id", secret: "your-secret")
To get an ID and secret, create a new client using the Spotify Dashboard.
From there, you can send requests via the associated module:
album = Crystalize::Album.get("3ogb5zqMrLtSbT4HAvQhPc").not_nil! album.name.should eq "Твой первый диск - моя кассета" album.artists.first.name.should eq "Tima Belorusskih"
Crystalize's API can be found at https://t1ra.github.io/crystalize, and Spotify's API reference can be found at https://developer.spotify.com/documentation/web-api/reference/. Using these, it shouldn't be difficult to thoroughly understand Crystalize.
- Albums ✅
- Artists ✅
- Browse ✅
- Tracks ✅
- Playlists (Partial?)
- Users Profile (Partial?)
Why the long-term goals?
The long-term goal endpoints require authentication from a user, which, generally, requires a lot more setup to get than bot authentication. Until all of the bot-available endpoints are ready, there's no plan to implement user-based endpoints.
Users Profile can be partially implemented because some endpoints require user authentication
/v1/me), while others (
- Fork it (https://github.com/t1ra/crystalize/fork)
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- If you're fixing a bug, confirm your changes fix the issue and ensure the
- If you're adding a feature, write a new test. In the case of a new endpoint, make sure that the test at least ensures the endpoint is demarshalled correctly.
- If you're fixing a bug, confirm your changes fix the issue and ensure the library passes
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
If you simply pull the repo and run
crystal spec, tests will fail because Crystalize doesn't
have any credentials to use. To add your own, create
spec/auth.cr and add the following:
module Auth @@id = "YOUR-ID" @@secret = "YOUR-SECRET" def self.id @@id end def self.secret @@secret end end
@@secret with your own.