Skip to content

Gateway to Research API reference

Generated from the source with mkdocstrings. Every name below is importable from bibliofabric.ukrigtr; nested value models stay importable from bibliofabric.ukrigtr.models.

Client

bibliofabric.ukrigtr.UkriGtrClient

Client for the UKRI Gateway to Research (GTR-2) API.

The API needs no credentials. The client sends Accept: application/vnd.rcuk.gtr.json-v7 on every request; without a versioned Accept header the API answers XML.

projects: ProjectsResource cached property

The project resource: /projects queries and sub-routes.

persons: PersonsResource cached property

The person resource: /persons queries and sub-routes.

organisations: OrganisationsResource cached property

The organisation resource: /organisations queries and sub-routes.

funds: FundsResource cached property

The fund resource: /funds queries and /funds/{id}.

outcomes: OutcomesResource cached property

The outcome resource: the merged /outcomes route and the types.

configs: ConfigsResource cached property

The metadata resource: /configs/{resource} and /examples.

Settings

bibliofabric.ukrigtr.UkriGtrSettings

Gateway to Research client settings.

Inherits timeout, max_retries, max_retry_wait, max_requests_per_second, max_concurrency, user_agent and mailto from :class:bibliofabric.config.BaseApiSettings and sets Gateway to Research defaults (2 requests per second, concurrency 2). The API needs no credentials.

Resources

bibliofabric.ukrigtr.ProjectsResource

Client for project records: /projects queries and sub-routes.

funds(id: str, *, query: str | None = None, sort: str | Sequence[str] | None = None, page: int | None = None, page_size: int | None = None, on_error: OnError = _ON_ERROR_DEFAULT, failures: list[ValidationError] | None = None, params: dict[str, object] | None = None) -> Page[Fund] async

Fetch one page of the fund records of a project.

persons(id: str, *, query: str | None = None, sort: str | Sequence[str] | None = None, page: int | None = None, page_size: int | None = None, on_error: OnError = _ON_ERROR_DEFAULT, failures: list[ValidationError] | None = None, params: dict[str, object] | None = None) -> Page[Person] async

Fetch one page of the person records of a project.

organisations(id: str, *, query: str | None = None, sort: str | Sequence[str] | None = None, page: int | None = None, page_size: int | None = None, on_error: OnError = _ON_ERROR_DEFAULT, failures: list[ValidationError] | None = None, params: dict[str, object] | None = None) -> Page[Organisation] async

Fetch one page of the organisation records of a project.

outcomes(id: str, *, page: int | None = None, page_size: int | None = None, on_error: OnError = _ON_ERROR_DEFAULT, failures: list[ValidationError] | None = None, params: dict[str, object] | None = None) -> Page[Outcome] async

Fetch one page of the outcome records of a project (all types merged).

Per-type project outcome pages live on the typed outcome resources, for example client.outcomes.key_findings.for_project(id).search().

bibliofabric.ukrigtr.PersonsResource

Client for person records: /persons queries and sub-routes.

projects(id: str, *, query: str | None = None, sort: str | Sequence[str] | None = None, page: int | None = None, page_size: int | None = None, on_error: OnError = _ON_ERROR_DEFAULT, failures: list[ValidationError] | None = None, params: dict[str, object] | None = None) -> Page[Project] async

Fetch one page of the projects of a person.

organisations(id: str, *, query: str | None = None, sort: str | Sequence[str] | None = None, page: int | None = None, page_size: int | None = None, on_error: OnError = _ON_ERROR_DEFAULT, failures: list[ValidationError] | None = None, params: dict[str, object] | None = None) -> Page[Organisation] async

Fetch one page of the organisations of a person.

bibliofabric.ukrigtr.OrganisationsResource

Client for organisation records: /organisations queries and sub-routes.

funds(id: str, *, query: str | None = None, sort: str | Sequence[str] | None = None, page: int | None = None, page_size: int | None = None, on_error: OnError = _ON_ERROR_DEFAULT, failures: list[ValidationError] | None = None, params: dict[str, object] | None = None) -> Page[Fund] async

Fetch one page of the fund records of an organisation.

persons(id: str, *, query: str | None = None, sort: str | Sequence[str] | None = None, page: int | None = None, page_size: int | None = None, on_error: OnError = _ON_ERROR_DEFAULT, failures: list[ValidationError] | None = None, params: dict[str, object] | None = None) -> Page[Person] async

Fetch one page of the person records of an organisation.

projects(id: str, *, query: str | None = None, sort: str | Sequence[str] | None = None, page: int | None = None, page_size: int | None = None, on_error: OnError = _ON_ERROR_DEFAULT, failures: list[ValidationError] | None = None, params: dict[str, object] | None = None) -> Page[Project] async

Fetch one page of the projects of an organisation.

bibliofabric.ukrigtr.FundsResource

Client for fund records: /funds queries and /funds/{id}.

The fund records of one project or organisation live on the projects.funds() and organisations.funds() methods.

bibliofabric.ukrigtr.OutcomesResource

Client for the merged /outcomes route and the per-type routes.

The merged route pages one global stream grouped by outcome type in alphabetical order; each typed attribute (key_findings, publications, ...) offers search, iterate, count, get, and exists against that type's own route. The other_research_items type has no upstream route.

key_findings: OutcomeTypeResource[KeyFinding] property

/outcomes/keyfindings: key finding outcomes.

impact_summaries: OutcomeTypeResource[ImpactSummary] property

/outcomes/impactsummaries: impact summary outcomes.

publications: OutcomeTypeResource[Publication] property

/outcomes/publications: publication outcomes.

collaborations: OutcomeTypeResource[Collaboration] property

/outcomes/collaborations: collaboration outcomes.

intellectual_properties: OutcomeTypeResource[IntellectualProperty] property

/outcomes/intellectualproperties: intellectual property outcomes.

policy_influences: OutcomeTypeResource[PolicyInfluence] property

/outcomes/policyinfluences: policy influence outcomes.

products: OutcomeTypeResource[Product] property

/outcomes/products: product intervention outcomes.

research_materials: OutcomeTypeResource[ResearchMaterial] property

/outcomes/researchmaterials: research material outcomes.

spin_outs: OutcomeTypeResource[SpinOut] property

/outcomes/spinouts: spin out outcomes.

further_fundings: OutcomeTypeResource[FurtherFunding] property

/outcomes/furtherfundings: further funding outcomes.

disseminations: OutcomeTypeResource[Dissemination] property

/outcomes/disseminations: dissemination outcomes.

artistic_products: OutcomeTypeResource[ArtisticAndCreativeProduct] property

/outcomes/artisticandcreativeproducts: artistic product outcomes.

software_products: OutcomeTypeResource[SoftwareAndTechnicalProduct] property

/outcomes/softwareandtechnicalproducts: software product outcomes.

exploitations: OutcomeTypeResource[Exploitation] property

Upstream serves no route for this type; accessing it raises.

The records still appear in the merged /outcomes stream.

other_research_items: OutcomeTypeResource[Outcome] property

Upstream serves no route for this type; accessing it raises.

The records still appear in the merged /outcomes stream.

research_databases: OutcomeTypeResource[ResearchDatabaseAndModel] property

Upstream serves no route for this type; accessing it raises.

The records still appear in the merged /outcomes stream.

first(filters: BaseModel | Mapping[str, Any] | None = None, *, query: str | None = None, sort: str | Sequence[str] | None = None, select: Sequence[str] | None = None, page_size: int | None = UKRIGTR_MIN_PAGE_SIZE, cursor: str | None = None, on_error: OnError = 'raise', failures: list[ValidationError] | None = None, params: Mapping[str, Any] | None = None) -> Outcome | None async

Return the first merged outcome, or None when there is none.

Reads one page of search() directly because collect() routes through the disabled merged iterate().

bibliofabric.ukrigtr.OutcomeTypeResource

Typed client for one /outcomes/{type} route.

for_project(project_id) returns the same client bound to the project-scoped route (/projects/{id}/outcomes/{type}).

for_project(project_id: str) -> Self

Return this client bound to one project's outcomes of this type.

bibliofabric.ukrigtr.ConfigsResource

Client for /configs/{resource} and the /examples directory.

get("projects") fetches the query parameters and search fields of one resource; unknown names raise :class:NotFoundError.

examples() -> list[Endpoint] async

Return every endpoint the API documents, with example requests.

Sync twins

UkriGtrSyncClient, ProjectsSyncResource, PersonsSyncResource, OrganisationsSyncResource, FundsSyncResource, OutcomesSyncResource, OutcomeTypeSyncResource, and ConfigsSyncResource are the generated sync twins of the classes above, with the same methods without async and await. See Async and sync clients.

Models

bibliofabric.ukrigtr.Project

One funded project of the Gateway to Research.

start and end are epoch milliseconds; the funded dates usually live on the linked fund records instead. Unknown fields are kept.

bibliofabric.ukrigtr.Person

One person of the Gateway to Research.

bibliofabric.ukrigtr.Organisation

One organisation of the Gateway to Research.

bibliofabric.ukrigtr.Fund

One fund record; the funded value and dates of a project.

start and end are epoch milliseconds.

bibliofabric.ukrigtr.Outcome

One outcome record of any type.

The per-type subclasses add the fields their records carry. A record of one type validates against every other type too, because all fields are optional and unknown fields are kept.

bibliofabric.ukrigtr.Publication

A publication outcome.

date_published_at: datetime | None property

The datePublished epoch milliseconds as an aware UTC datetime.

bibliofabric.ukrigtr.KeyFinding

A key finding outcome.

bibliofabric.ukrigtr.ImpactSummary

An impact summary outcome.

bibliofabric.ukrigtr.ResourceConfig

The query parameters and search fields of one resource.

Helpers

One link to a related resource.

start and end are epoch milliseconds when the relationship has a date range (a fund link, for example); they are None otherwise.

bibliofabric.ukrigtr.models.Money

A fund value (valuePounds).

bibliofabric.ukrigtr.models.TopicCategory

One classified concept of a project (subject, topic, activity, programme).