Thanks to visit codestin.com
Credit goes to lib.rs

72 releases (4 stable)

1.0.3 Jul 30, 2025
1.0.1 Jun 12, 2025
1.0.0 Jan 13, 2025
0.15.2 Jan 8, 2025
0.2.5 Nov 26, 2022

#1 in #mastodon

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

853 downloads per month
Used in 7 crates

MIT license

1MB
32K SLoC

Megalodon

Crates.io docs.rs Build GitHub

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.

Supporting

  • Mastodon
  • Pleroma
  • Friendica
  • Firefish
  • Gotosocial
  • Pixelfed
  • Akkoma (Unofficial)
  • Sharkey (Unofficial)
  • Hometown (Unofficial)
  • Iceshrimp (Unofficial)

Features

  • REST API
  • Admin API
  • WebSocket for Streamings

Usage

Add your Cargo.toml like this:

[dependencies]
megalodon = { version = "0.11" }

Making Mastodon request

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());

Making Mastodon request with authentication

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());

License

The software is available as open source under the terms of the Apache License 2.0.

Dependencies

~12–34MB
~484K SLoC