4 releases
0.1.4 | Mar 30, 2024 |
---|---|
0.1.3 | Sep 1, 2023 |
0.1.2 | Jul 3, 2023 |
0.1.1 | Jul 3, 2023 |
0.1.0 |
|
#185 in Audio
197 downloads per month
70KB
951 lines
musixmatch-rs
This repository offers a wide range of functionalities that can be leveraged to build music applications requiring access to this musicmatch. By utilizing this Rust implementation, developers can seamlessly integrate MusixMatch API capabilities into their Rust projects, enabling the development of powerful and feature-rich music applications.
About
The MusixMatch API is a comprehensive service that provides access to music metadata, lyrics, and album art. It offers a wide range of functionalities, including:
- Searching for songs, artists, and albums
- Retrieving lyrics for a given song
- Accessing album details and artwork
- Discovering top tracks, artists, and albums by country
- Fetching music genres and related data
By leveraging the MusixMatch API, developers can build music applications that require access to this rich set of music-related data. The musixmatch-rs
crate provides a convenient Rust implementation for interacting with the MusixMatch API, enabling seamless integration into Rust projects.
For more information about the MusixMatch API and its capabilities, please refer to the MusixMatch API Documentation.
Features
marocs
: Enables the use of default arguments for methods using thedefault-args
crate.
Installation
Add this to your Cargo.toml
for default features:
[dependencies]
musixmatch = "0.1.1" # Note version at time of writing
With the marocs
feature enabled, you can use default arguments for methods in the MusixAbgleich API. This allows you to omit certain parameters and have them set to default values automatically (None).
[dependencies]
musixmatch = { version = "0.1.1", features = ["marcos"] } # Note version at time of writing
Usage
To use the MusixMatch API, you need an API key. Follow these steps to obtain an API key:
- Visit the MusixMatch Developer Portal and click on "Getting Started" to begin the process.
- Fill in the required information to create a developer account. Provide your name, email address, and choose a password. Accept the terms and conditions, and then click on "Sign Up" to create your account.
- Click on "Create New Application" to start creating a new application. Provide the necessary details such as the application name, description, and website URL. You may also need to specify the type of application and agree to any additional terms or policies.
- Once you have filled in the required information, submit the application.
- After your application is reviewed and approved, you will receive an email notification containing your API key. This key will be associated with the application you created.
Note
: The exact steps and process may vary slightly depending on any updates or changes made to the MusixMatch Developer Portal. Please refer to the official documentation provided by MusixMatch for the most up-to-date instructions on obtaining an API key.
use musixmatch::MusixAbgleich;
#[tokio::main]
async fn main() {
// Create an instance of MusixAbgleich
let musicabgleich = MusixAbgleich::new("your_api_key",&|error|{
// Custom error handler for handling errors
})
// Call methods with default arguments
let artists = musicabgleich.top_artists_by_country(Some("US"), None, None).await;
println!("{:?}", artists);
//Or when using marcos feature
let marco_feature_artist = top_artists_by_country!(musicabgleich,country = "US").await;
println!("{:?}", marco_feature_artist);
}
Please note that the examples provided here are simplified and serve as a starting point. For comprehensive documentation of the crate, please visit the crate documentation for a better understanding of the crate's functionalities and APIs.
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.
Dependencies
~4–16MB
~220K SLoC