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
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 heavily WIP. It is usable, but doesn't cover most of the API and may not have a stable interface. It's not yet recommended to use Crystalize in important software. There is very little documentation.
- Add the dependency to your
dependencies: crystalize: github: t1ra/crystalize
To use Crystalize, you first have to instantise it:
client = Crystalize::Client.new(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
album = client.get_album("3ogb5zqMrLtSbT4HAvQhPc") # Album ID puts album.name # "Твой первый диск - моя кассета" puts album.artists.name # "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 ✅
- 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.