Podbean API Client
A fully async Rust client for the Podbean API, built with Tokio and Reqwest.
Features
- Fully async: Built on Tokio runtime and Reqwest for efficient HTTP requests
- OAuth2 support: Handles authentication, token refresh, and authorization flows
- Rate limiting: Built-in rate limiting to avoid hitting API limits
- Comprehensive API coverage: Supports podcasts, episodes, media files, and more
- Proper error handling: Custom error types with detailed information
- Type-safe: Strongly typed API responses with Serde
Installation
Add the following to your Cargo.toml:
[]
= "0.2.0"
= { = "1", = ["macros", "rt-multi-thread"] }
Quick Start
use PodbeanClient;
async
Examples
Uploading and Publishing a Podcast Episode
use ;
async
Managing Episodes
use PodbeanClient;
async
API Reference
Authentication
PodbeanClient::new(client_id, client_secret)- Create a new clientclient.get_authorization_url(redirect_uri, state)- Generate OAuth authorization URLclient.authorize(code, redirect_uri)- Exchange authorization code for tokenclient.refresh_token()- Refresh the access token when expired
Podcasts
client.list_podcasts(offset, limit)- List podcasts for the authenticated user
Episodes
client.list_episodes(podcast_id, offset, limit)- List episodesclient.get_episode(episode_id)- Get a specific episodeclient.publish_episode(podcast_id, title, content, media_key, EpisodeStatus::Draft, EpisodeType::Public, publish_timestamp)- Publish a new episodeclient.update_episode(episode_id, title, content, status, publish_timestamp)- Update an episodeclient.delete_episode(episode_id)- Delete an episode
Media Files
client.upload_media(file_name, file_bytes, content_type)- Upload a media fileclient.list_media(offset, limit)- List media files
Error Handling
The library uses a custom PodbeanError type that provides detailed information about what went wrong:
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.