Activities
GET /api/activities
Returns activities stored in OSIRIS.
This endpoint can be used to retrieve activity records, select specific fields, filter results, aggregate records by a field, or export full activity data.
The API key can be passed as query parameter:
1 | |
or as HTTP header:
1 | |
Parameters
| Parameter | Type | Description |
|---|---|---|
apikey |
string | API key, if required. |
json |
string | JSON-encoded MongoDB filter. Overrides filter if both are provided. |
filter |
object/array | Alternative MongoDB filter using bracket notation, e.g. filter[year]=2025. Values supplied this way are strings; use json for typed values. |
columns[] |
array | Optional list of fields to return. |
aggregate |
string | Groups activities by the given field and returns counts. |
full |
flag | Returns full activity records as streamed JSON when present, including full=0. Ignored if aggregate is present. |
limit |
integer | Limits the number of returned records. |
offset |
integer | Number of rows to skip when limit is used. Defaults to 0; negative values become 0. |
Default Response
Without additional parameters, the endpoint returns a compact activity list.
1 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Default fields:
| Field | Description |
|---|---|
id |
Activity ID as string. |
activity |
Rendered HTML representation for web display. |
icon |
Icon representing the activity type. |
type |
Rendered activity type. |
subtype |
Rendered activity subtype. |
year |
Activity year. |
Selecting Columns
Use columns[] to request specific fields.
1 | |
Some fields are read from the rendered activity representation:
1 | |
All other fields are read directly from the activity record. Do not explicitly select columns[]=id if you need the generated MongoDB ID: this replaces it with the stored id field.
Example:
1 | |
1 2 3 4 5 6 7 8 9 10 11 12 | |
Filtering
Use the json parameter to pass a MongoDB filter.
1 | |
URL-encoded:
1 | |
Example: publications from 2025:
1 2 3 4 | |
Example with MongoDB operator:
1 2 3 4 5 | |
Pagination
The compact list and aggregation use the shared limit and offset parameters. count contains the number of matching rows before slicing (the number of groups for aggregation).
1 | |
offset=100 skips the first 100 matching rows, and the response reports the integer offset: 100. Pagination also applies when count <= limit; offsets at or beyond the end return an empty array. Full exports ignore both parameters. See API Basics.
Aggregation
Use aggregate to group activities by one field.
1 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Aggregation can be combined with filters:
1 | |
The current implementation requires a non-empty filter for this aggregation: without one, the empty PHP array passed to MongoDB as $match can cause a database error and a non-JSON response. Use an explicit filter as above, or activity search for unfiltered aggregation.
If the aggregation field contains authors, OSIRIS unwinds the authors array before grouping.
Example:
1 | |
Full Export
Use full=1 to retrieve full activity records.
1 | |
This returns streamed JSON:
1 2 3 4 5 6 7 8 9 10 11 | |
This mode is intended for exports or synchronization. It may return large datasets.
Response Behavior
Compact records are sorted by year descending. Projected fields may be omitted when the corresponding stored or rendered field is missing. Rendered fields contain display text or HTML and depend on the OSIRIS language and configuration; icon can contain HTML rather than an icon class alone.
Full records are sorted by _id descending and retain all stored fields, including _id in MongoDB Extended JSON form ({"$oid":"..."}). The presence of full activates this mode; columns[], limit, and offset are ignored. count is the number of streamed records.
For authenticated sessions without an apikey query parameter, OSIRIS also applies the user's activity visibility filter, even if the API key was supplied as a header.