16 stable releases (3 major)

3.4.1 Apr 30, 2024
3.4.0 Jan 27, 2024
3.3.0 Dec 27, 2023
3.2.1 Aug 21, 2023
0.1.1 Nov 29, 2021

#32 in Caching

Download history 5/week @ 2024-01-26 24/week @ 2024-02-23 133/week @ 2024-03-01 49/week @ 2024-03-08 43/week @ 2024-03-15 4/week @ 2024-03-22 46/week @ 2024-03-29 24/week @ 2024-04-05 10/week @ 2024-04-12 10/week @ 2024-04-19 127/week @ 2024-04-26 24/week @ 2024-05-03

173 downloads per month

MIT license

1.5K SLoC

Rustemon Latest Version

This library is a wrapper for the awesome PokeApi, which provides all the informations you need about Pokémons !

Fully written in Rust, this library covers the whole PokeApi REST api v2.

How to import it ?

Adds the following in the dependencies of your Cargo.toml :

rustemon = "3.4.1" 

How to use it ?

As you noticed in the documentation of PokeApi, every endpoints and models are declared in groups.

The library kept this group oriented architecture !


This crate provides two features to enable different cache mechanisms :

  • filesystem-cache -> A configurable cache stored in files.
  • in-memory-cache -> A configurable in-memory cache.

filesystem-cache is enabled by default. Be careful, those features are mutually exclusive !! If you want to use the in-memory-cache feature, you can proceed as follow:

rustemon = { version = "*", default-features = false, features = ["in-memory-cache"] } 

All the models are located into the following module :


For example, if you want the type Pokemon located in the group pokemon, it is located here :


The endpoints follow the same naming rule, for example, if you want to call the evolution chain endpoint from the evolution group :


For each endpoints, 4 functions are defined :

  • get_page : without parameters, calls the endpoint without any informations to retrieve the first page of the paginated response for the endpoint, as defined here,
  • get_page_with_param : allows you to modify the parameters for the paginated query,
  • get_by_id : calls the endpoint using the id of the targeted resource,
  • get_by_name : calls the endpoint using the name of the targeted resource.

The endpoints are all async ! Which means you NEED to add a async runtime (such as tokio for example), in order for the library to work.


All calls to the API are cached by a middleware attached to the RustemonClient you need to instanciate in order to make calls to the PokeAPI.


Examples and use cases are available in the examples folder. For instance, you can run the async_follow example using

cargo run --example async_follow


The license of the library can be found here.


If you find any bug or improvement that you find valuable, please fill an issue right there -> project issues


~630K SLoC