Expand description
Official Rust SDK for the AudD music recognition API.
use audd::AudD;
let audd = AudD::new("test");
if let Some(result) = audd.recognize("https://audd.tech/example.mp3").await? {
println!("{} — {}", result.artist.as_deref().unwrap_or(""), result.title.as_deref().unwrap_or(""));
}Use AudD::builder to configure retries, timeouts, or a custom
reqwest::Client. See the README for a full capability tour and the
audd-openapi repository for the
canonical API contract.
Re-exports§
pub use advanced::Advanced;pub use client::AudD;pub use client::AudDBuilder;pub use client::AudDEvent;pub use client::EnterpriseOptions;pub use client::EventKind;pub use client::OnEventHook;pub use custom_catalog::CustomCatalog;pub use errors::error_for_code;pub use errors::AudDError;pub use errors::ErrorKind;pub use helpers::add_return_to_url;pub use helpers::derive_longpoll_category;pub use helpers::handle_callback;pub use helpers::parse_callback;pub use longpoll::LongpollConsumer;pub use longpoll::LongpollConsumerBuilder;pub use longpoll::LongpollIterateOptions;pub use models::AppleMusicMetadata;pub use models::CallbackEvent;pub use models::DeezerMetadata;pub use models::EnterpriseChunkResult;pub use models::EnterpriseMatch;pub use models::LyricsResult;pub use models::MusicBrainzEntry;pub use models::NapsterMetadata;pub use models::RecognitionMatch;pub use models::RecognitionResult;pub use models::SpotifyMetadata;pub use models::Stream;pub use models::StreamCallbackMatch;pub use models::StreamCallbackNotification;pub use models::StreamCallbackSong;pub use models::StreamingProvider;pub use retry::RetryClass;pub use retry::RetryPolicy;pub use source::Source;pub use streams::LongpollOptions;pub use streams::LongpollPoll;pub use streams::Streams;
Modules§
- advanced
advanced.*namespace — lyrics search and a generic raw-request escape hatch.- client
- Public
AudDclient and its builder. - custom_
catalog - Custom-catalog endpoint. NOT for music recognition — see
CustomCatalog::add. - errors
- Typed error enum for the AudD SDK. Mirrors the audd-python exception hierarchy projected into a single Rust enum.
- helpers
- Pure helpers: longpoll category derivation, callback parsing, return-URL builder. No HTTP or SDK state.
- longpoll
- Tokenless longpoll consumer for browser/widget/extension use cases.
- models
- Typed models with
#[serde(flatten)] extrason every type so unknown server fields round-trip without an SDK release. - retry
- Cost-aware retry policy.
- source
- Source enum + per-attempt re-opener pattern (locked C1).
- streams
- Streams namespace — set/get callback URL, addStream/listStreams/setStreamUrl/deleteStream,
longpoll with default-on preflight (and
skip_callback_checkopt-out),derive_longpoll_category,parse_callback.
Constants§
- VERSION
- The published version of this SDK (matches
Cargo.toml).