| Crates.io | connected-papers |
| lib.rs | connected-papers |
| version | 0.1.1 |
| created_at | 2025-12-29 02:39:00.317345+00 |
| updated_at | 2026-01-04 07:17:52.886057+00 |
| description | A Rust client for Connected Papers integrated with Semantic Scholar utilities. |
| homepage | |
| repository | https://github.com/tangxiangong/connected-papers |
| max_upload_size | |
| id | 2009867 |
| size | 189,400 |
A Rust client for Connected Papers integrated with Semantic Scholar utilities, inspired by the Official Python Client.
use connected_papers::ConnectedPapers;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ConnectedPapers::with_api_key("your_api_key_here");
let response = client
.get_graph("9397e7acd062245d37350f5c05faf56e9cfae0d6", false)
.await?;
println!("{response:#?}");
Ok(())
}
use connected_papers::ConnectedPapers;
use futures::StreamExt;
use std::io::{self, Write};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ConnectedPapers::with_api_key("TEST_TOKEN");
let mut stream =
client.get_graph_stream("9397e7acd062245d37350f5c05faf56e9cfae0d6", false, true);
let mut stdout = io::stdout();
while let Some(result) = stream.next().await {
match result {
Ok(response) => {
writeln!(stdout, "{response:#?}")?;
stdout.flush()?;
}
Err(e) => {
writeln!(stdout, "Error: {e}")?;
stdout.flush()?;
return Err(e.into());
}
}
}
Ok(())
}
let remaining = client.get_remaining_usages().await?;
println!("Remaining API calls: {}", remaining);
let papers = client.get_free_access_papers().await?;
println!("{papers:#?}");
Licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.