| Crates.io | megalodon |
| lib.rs | megalodon |
| version | 1.0.3 |
| created_at | 2022-09-23 08:28:03.240653+00 |
| updated_at | 2025-07-30 14:03:16.381776+00 |
| description | Mastodon and Pleroma API client library for Rust. |
| homepage | https://github.com/h3poteto/megalodon-rs |
| repository | https://github.com/h3poteto/megalodon-rs |
| max_upload_size | |
| id | 672328 |
| size | 1,688,718 |
The megalodon is a client library for Fediverse. It provides REST API and streaming method which uses WebSocket. By using this library, you can take Mastodon, Pleroma, and Friendica with the same interface.
This library is Rust version of megalodon.
REST API
Admin API
WebSocket for Streamings
Add your Cargo.toml like this:
[dependencies]
megalodon = { version = "0.11" }
For a request without authentication.
let client = megalodon::generator(
megalodon::SNS::Mastodon,
String::from("https://fedibird.com"),
None,
None,
);
let res = client.get_instance().await?;
println!("{:#?}", res.json());
For a request with authentication.
let client = megalodon::generator(
megalodon::SNS::Mastodon,
String::from("https://fedibird.com"),
Some(String::from("your access token")),
None,
)?;
let res = client.verify_account_credentials().await?;
println!("{:#?}", res.json());
The software is available as open source under the terms of the Apache License 2.0.