semanticscholar
A Rust wrapper around the Semantic Scholar API.
Also on crates.io.
Installation
Add to your Cargo.toml:
[]
= "0.2"
= { = "1", = ["full"] }
Usage
use Client;
async
Types
| Type | Description |
|---|---|
Client |
HTTP client for the Semantic Scholar API. Reuses connections across requests. |
Work |
A paper, including metadata, authors, topics, citations, and references. |
Author |
A paper author with optional ID, name, and URL. |
Topic |
A topic associated with a paper. |
Error |
Error enum covering invalid JSON, API errors, and HTTP failures. |
Papers can be looked up by DOI, arXiv ID, or Semantic Scholar paper ID.
Error Handling
All API calls return Result<_, semanticscholar::Error>. The error type has three variants:
Error::Http— network or connection failureError::Api— the API returned an error (e.g. paper not found)Error::InvalidJson— the response could not be parsed
License
MIT