Skip to content

omnischolar/openalex 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/openalex:1.x-dev

Read from the package's own PHP files at the commit a7e7c4813817: 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\OpenAlex

  • OpenAlexSource class

    OpenAlex (api.openalex.org): an author's profile with their counts (works, citations, h-index, i10-index, by year) and the institutions seen on their works; their works with abstracts, citations and open-access links; any work by its OpenAlex id, DOI or PubMed id; a search.

    8 methods · 2 constants

  • OpenAlexSourceFactory class

    OpenAlex: profiles, works, citations, h-index - no key needed.

    3 options

Omnischolar\OpenAlex

OpenAlexSource class

final class OpenAlexSource extends HttpSource OpenAlexSource.php:31

OpenAlex (api.openalex.org): an author's profile with their counts (works, citations, h-index, i10-index, by year) and the institutions seen on their works; their works with abstracts, citations and open-access links; any work by its OpenAlex id, DOI or PubMed id; a search.

Free without a key within a daily budget; a free key (api_key) raises it tenfold. The mailto is sent as OpenAlex asks of polite callers.

const BASE_URI = 'https://api.openalex.org/'
const MAX_PER_PAGE = 100

The most per page OpenAlex serves.

OpenAlexSource::__construct()

public function __construct(HttpClientInterface $http, readonly ?string $mailto = null, readonly ?string $apiKey = null, readonly bool $paratext = false, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.0)

OpenAlexSource::getName()

public function getName(): string

OpenAlexSource::capabilities()

public function capabilities(): array

OpenAlexSource::author()

public function author(Identifier|string $author): ?Author

OpenAlexSource::works()

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

OpenAlexSource::work()

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

OpenAlexSource::abstract()

public static function abstract(?array $index): ?string

The abstract, rebuilt from the index OpenAlex serves (each word with its positions).

OpenAlexSourceFactory class

final class OpenAlexSourceFactory extends SourceFactory OpenAlexSourceFactory.php:20

OpenAlex: profiles, works, citations, h-index - no key needed.

options: mailto: 'support@glitchr.io' # sent with every call, as OpenAlex asks api_key: ~ # a free key from openalex.org/settings/api: ten times the keyless daily budget paratext: false # true keeps covers, tables of contents and the like base_uri: 'https://api.openalex.org/' throttle: 0 # seconds between two calls

Options

OptionDefault
api_keynull
paratextfalse
base_uriOpenAlexSource::BASE_URI