Skip to content

omnischolar/arxiv API reference

Floor
Provider · Omnischolar
Version
1.x
Conformance suite
not wired
Verified for real
Its README does not say
Licence
MIT
composer require omnischolar/arxiv:1.x-dev

Read from the package's own PHP files at the commit c24ed75ef37d: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.

Omnischolar\Arxiv

  • ArxivSource class

    arXiv (export.arxiv.org/api, Atom, no key): preprints - an author's by name, one by its arXiv id (old "hep-th/9711200" or new "2401.12345" style), a search - with their abstracts, categories, PDF, and the DOI and journal reference of the published version when the authors added them.

    6 methods · 2 constants

  • ArxivSourceFactory class

    arXiv: preprints, by author name, id or search - no key.

    2 options

Omnischolar\Arxiv

ArxivSource class

final class ArxivSource extends HttpSource ArxivSource.php:29

arXiv (export.arxiv.org/api, Atom, no key): preprints - an author's by name, one by its arXiv id (old "hep-th/9711200" or new "2401.12345" style), a search - with their abstracts, categories, PDF, and the DOI and journal reference of the published version when the authors added them.

arXiv knows no author profiles, and asks for one call every three seconds: the throttle leaves them.

const BASE_URI = 'https://export.arxiv.org/api/'
const MAX_RESULTS = 2000

The most entries arXiv serves per call.

ArxivSource::__construct()

public function __construct(HttpClientInterface $http, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 3.0)

ArxivSource::getName()

public function getName(): string

ArxivSource::capabilities()

public function capabilities(): array

ArxivSource::works()

public function works(Identifier|string $author, ?Query $query = null): Page

An author's preprints, by the name they sign ("Juan Maldacena", "Maldacena, Juan"). The cursor is an offset.

ArxivSource::work()

public function work(Identifier|string $id): ?Work
public function search(Query $query): Page

ArxivSourceFactory class

final class ArxivSourceFactory extends SourceFactory ArxivSourceFactory.php:18

arXiv: preprints, by author name, id or search - no key.

options: throttle: 3 # seconds between two calls, as arXiv asks mailto: 'support@glitchr.io' # in the User-Agent base_uri: 'https://export.arxiv.org/api/'

Options

OptionDefault
throttle3.0
base_uriArxivSource::BASE_URI