AIREloom: Python client for the OpenAIRE API
Samuel Mok · s.mok@utwente.nl · 2025–2026
AIREloom is a Python client for the OpenAIRE Graph API and Scholexplorer API, built on bibliofabric. It ships an async client and a generated sync twin (AireloomSyncClient) with the same API surface.
Docs: utsmok.github.io/bibliofabric/aireloom · PyPI: aireloom · License: MIT
Features
- Graph API V4 for list operations — the recommended filter-based queries (
filter=field:value,sort=field:dir,select,facets,group_by, cursor paging up to 10000 per page); single-entity lookups use the stable V3 by-id routes - Async first, sync everywhere — async built on
httpx+asynciowith retries, a client-side rate limiter (2 req/s, concurrency 4), and typed errors; the generated sync twin runs onhttpx.Client,time.sleep, and threads, and works in scripts, notebooks, and inside a running event loop - Typed throughout — Pydantic models for all inputs and outputs, PEP 561
py.typed;search()returnsbibliofabric.Page[E] - Scholix V3 (V2 for date filters) — typed link records through a dedicated internal client for the Scholexplorer host
- Anonymous or OAuth2 — client credentials against the Keycloak endpoint, or no auth at all
Installation
uv add aireloom
Requires Python ≥3.12.
Quick Start
import asyncio
from aireloom import AireloomClient, ResearchProductsFilters
async def main():
async with AireloomClient() as client:
# Search publications (V4 filter-based query)
filters = ResearchProductsFilters(
type="publication",
title_search="climate change",
from_publication_year=2024,
)
page = await client.research_products.search(
filters,
sort="publication_date:desc",
page_size=5,
)
for product in page.results:
print(f"{product.mainTitle} — DOI: {product.doi or 'N/A'}")
# Iterate all results (cursor-based, resumable)
async for product in client.research_products.iterate(
ResearchProductsFilters(type="dataset", authorships_countries=["NL"]),
page_size=100,
):
print(product.mainTitle)
break # stop whenever you want
# Get a single entity by OpenAIRE id (V3 by-id route)
product = await client.research_products.get(
"dedup_wf_002::016e036dfe4204781ee9bf94c8b06c1b"
)
# Batch-fetch by DOI (one OR filter per chunk of 50)
products = await client.research_products.batch_get_by_doi(
["10.5281/zenodo.15069438", "10.1038/s41586-023-06221-2"]
)
# Aggregations
counts = await client.research_products.group_by("type")
print(counts) # {'publication': 241566601, ...}
asyncio.run(main())
Sync
The same operations without asyncio, for scripts, notebooks, and code that
already runs inside an event loop:
from aireloom import AireloomSyncClient
with AireloomSyncClient() as client:
page = client.research_products.search(
query="quantum dots",
page_size=5,
)
for product in page.results:
print(product.mainTitle)
for product in client.research_products.iterate(page_size=100):
print(product.mainTitle)
break
products = client.research_products.batch_get_by_doi(
["10.5281/zenodo.15069438", "10.1038/s41586-023-06221-2"]
)
Both variants take the same parameters, raise the same errors, retry and page
the same way, and enforce the same rate limits. Resource attributes expose the
matching Sync* resource classes (SyncResearchProductsResource, ...).
No authentication required — the Graph API works without it. For higher rate limits, set credentials (see Authentication).
Core API
Retrieval methods
Every entity resource (client.research_products, client.projects,
client.organizations, client.data_sources, client.persons) provides:
| Method | Description |
|---|---|
get(id) |
Retrieve a single entity by OpenAIRE id (V3 by-id route) |
search(filters, query, sort, select, page, page_size, cursor) |
One page as Page[E] |
iterate(filters, page_size=100, limit, cursor, on_page) |
Auto-paginate all results (cursor-based, resumable) |
collect(limit, ...) |
Collect results into a list |
count(filters) |
Count matching entities cheaply |
first(filters) |
Get first matching entity or None |
facets(*fields, filters) |
Facet counts per field: {field: {value: count}} |
group_by(field, filters) |
Counts per value without fetching records |
batch_get(ids, field, batch_size) |
Fetch many ids via OR filters |
client.research_products additionally has batch_get_by_doi(dois),
search_links(), iterate_links(), and get_relations_info().
client.persons has batch_get_by_orcid(orcids).
Filters and sorting
Filters are typed Pydantic models in aireloom.filters, one per entity. Field
names follow the V4 filter syntax; dotted API fields use underscores with
aliases (ids_doi sends ids.doi). Lists become pipe-separated ORs, booleans
become true/false, and string values pass through operators such as
">100" or "!other":
from aireloom.filters import ResearchProductsFilters
filters = ResearchProductsFilters(
type="publication",
title_search="machine learning",
from_publication_year=2024,
authorships_countries=["NL", "BE"],
impact_citation_count=">100",
)
Sort with sort="citation_count:desc" (asc/desc, comma-separate several
fields). Valid fields are validated client-side per entity and raise
ConfigurationError.
Full-text search is a separate parameter: search(filters, query="...").
Authentication
AIREloom reads AIRELOOM_-prefixed environment variables or a .env file.
Without credentials the client is anonymous:
AIRELOOM_OPENAIRE_CLIENT_ID=your_id
AIRELOOM_OPENAIRE_CLIENT_SECRET=your_secret
Both set → OAuth2 client credentials against the OpenAIRE Keycloak endpoint
(https://aai.openaire.eu/auth/realms/openaire/protocol/openid-connect/token;
the legacy oidc/token endpoint is retired). You can also pass any
bibliofabric auth strategy explicitly:
from bibliofabric.auth import NoAuth, StaticTokenAuth
client = AireloomClient(auth=StaticTokenAuth(token="..."))
Scholix
client.scholix searches the Scholexplorer host (own rate limit: 1 req/s):
from aireloom.filters import ScholixFilters
page = await client.scholix.search_links(
ScholixFilters(sourcePid="10.1038/s41586-023-06221-2")
)
async for link in client.scholix.iterate_links(
ScholixFilters(sourcePid="10.1038/s41586-023-06221-2")
):
print(link.relationship_type.name, link.target.titles[0])
V3 serves all queries; queries with from_date/to_date are routed to V2
automatically because the V3 endpoint returns zero rows for date filters.
search_links_v2 / iterate_links_v2 target V2 directly, and
list_link_providers / list_link_publishers cover the V2 directory
endpoints. The V1 endpoints were removed.
Error Handling
from aireloom import (
BibliofabricError,
APIError,
AuthError,
ConfigurationError,
NetworkError,
NotFoundError,
RateLimitError,
TimeoutError,
ValidationError,
)
request() raises on every status ≥ 400 (404 → NotFoundError, 429 →
RateLimitError), and validation failures raise ValidationError carrying
the raw payload.
Known OpenAIRE API Issues
- Links and Scholix page sizes ≥ 100 silently return 10 results; AIREloom caps both at 99.
- V4
group_byeligibility is decided server-side per field: some fields return 400 ("not eligible"), others (e.g. projectsfunder_short_name) silently return empty counts. - Page-based routes (
links, Scholix) have no cursor or sort, so page windows can shift between requests during long iterations. - V3
from/todate filters on/v3/Linksreturn zero rows (V2 works).
Development
AIREloom lives in the bibliofabric uv workspace at packages/aireloom. From the repository root:
uv sync --all-packages --all-groups # install dev deps
uv run pytest packages/aireloom/tests -x -q # run tests
uv run ruff check # lint (workspace-wide)
uv run ty check packages/*/src # type check
Metadata
Release files for aireloom 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aireloom-0.8.0.tar.gz | 35.1 kB | With provenance | Details for aireloom-0.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aireloom-0.8.0-py3-none-any.whl | Python 3 | none | any | Details for aireloom-0.8.0-py3-none-any.whl |
Total release size: 80.6 kB
Release files / aireloom-0.8.0.tar.gz
| Download URL | aireloom-0.8.0.tar.gz |
|---|---|
| Size | 35.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b751e62d7b6dfd12710c9566c92efc9c23060afb72aba4821cd98c16259fd16e
|
|
BLAKE2b-256 checksum How to use checksums |
15c62e2b5483e40e314bbd75d05fb8fac9dc989259c25d1bcf501f91b311e92a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / aireloom-0.8.0-py3-none-any.whl
| Download URL | aireloom-0.8.0-py3-none-any.whl |
|---|---|
| Size | 45.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71b54cef95d589ba8ed3fc63eaa5ee56d1a74d6e5b0f26ca98b1d270494fbf19
|
|
BLAKE2b-256 checksum How to use checksums |
60242b4822a289b8b8a6e1cd9a349cea01bf11f17f64d555fe06937c24108317
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logSecurity for aireloom 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aireloom-0.8.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.