https://github.com/moisutsu/arxiv-rs
Wrapper of the arXiv API for Rust
https://github.com/moisutsu/arxiv-rs
arxiv-api rust
Last synced: 27 days ago
JSON representation
Wrapper of the arXiv API for Rust
- Host: GitHub
- URL: https://github.com/moisutsu/arxiv-rs
- Owner: moisutsu
- License: mit
- Created: 2020-08-20T09:02:23.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-23T14:01:16.000Z (8 months ago)
- Last Synced: 2025-08-20T16:29:07.385Z (3 months ago)
- Topics: arxiv-api, rust
- Language: Rust
- Homepage: https://crates.io/crates/arxiv-rs
- Size: 43.9 KB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Welcome to arxiv-rs 👋
[](https://crates.io/crates/arxiv-rs)
[](https://docs.rs/arxiv-rs)

This is a wrapper crate for the arXiv API
## Usage
Add dependencies to `Cargo.toml`
```toml
[dependencies]
arxiv-rs = "0.1.5"
tokio = { version = "1.3.0", features = ["full"]}
anyhow = "1.0.32"
```
Fetch the paper information and save it as a pdf
```rust
use anyhow::Result;
use arxiv::ArxivQueryBuilder;
#[tokio::main]
async fn main() -> Result<()> {
let query = ArxivQueryBuilder::new()
.search_query("cat:cs.CL")
.start(0)
.max_results(5)
.sort_by("submittedDate")
.sort_order("descending")
.build();
let arxivs = arxiv::fetch_arxivs(query).await?;
for arxiv in arxivs {
arxiv.fetch_pdf(&arxiv.title).await?;
}
Ok(())
}
```
You can easily build the query using the macro
```rust
use arxiv::query;
let query = query!(
search_query = "cat:cs.CL",
start = 0,
max_results = 5,
sort_by = "submittedDate",
sort_order = "descending"
);
```
## Show your support
Give a ⭐️ if this project helped you!
---
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_