Skip to content

add ChemRxiv commands: search, recent, preprint, categories via GraphQL - #1

Open
tamnd wants to merge 1 commit into
mainfrom
feat/pr1-chemrxiv-graphql
Open

add ChemRxiv commands: search, recent, preprint, categories via GraphQL#1
tamnd wants to merge 1 commit into
mainfrom
feat/pr1-chemrxiv-graphql

Conversation

@tamnd

@tamnd tamnd commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Implements chemrxiv-cli (binary `chemrxiv`) reading ChemRxiv preprints via the public GraphQL API.

Commands

  • `search [--skip N]` -- search preprints by keyword
  • `recent [--skip N]` -- most recent preprints
  • `preprint ` -- single preprint by ChemRxiv ID
  • `categories` -- list all subject categories

Notes

GraphQL endpoint at chemrxiv.org/engage/chemrxiv/public-api/graphql -- no auth needed.
Requires browser User-Agent + Origin/Referer headers for Cloudflare.
All preprints carry: doi, title, authors (last names, et al. at 4+), category, date, views, downloads, url.
`--skip` flag on search/recent lets callers page from an arbitrary offset; rank adjusts to skip+1 base.
15 tests, all offline via httptest.

…hods

Lets callers start from an arbitrary offset -- useful when paging through
results or resuming from a known position. Rank is adjusted so records
start from skip+1. Also adds two new tests: TestSearchFromSkip and
TestRateLimitedOn429.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant