filter parameter anywhere in the API, instead of pasting
hundreds of OpenAlex IDs into every request.
Collections are private to the user who creates them. Manage them via
authenticated requests against
user.openalex.org, and use the collection:
filter against api.openalex.org — both authenticated with your OpenAlex API
key in the Authorization: Bearer header. You can only filter on collections
you own.Concepts
A collection holds entities of a single type. To track works and the authors
of those works, create two collections.
Creating a collection
The easiest way to create a collection is in the OpenAlex web UI at openalex.org:- Run a search.
- Tick the rows you want to save (or use the master checkbox to select the whole page).
- Click the folder icon in the results toolbar → Create a new collection.
https://openalex.org/settings/collections.
To create one programmatically, POST to /me/collections:
entity_ids is optional — you can create an empty collection and add entities
later. IDs may be supplied in full-URL form (https://openalex.org/W123…) or
short form (W123…); the API normalizes them. Every ID must match the
collection’s entity_type — adding A123… to a works collection returns a
400 naming the offending ID.
A successful create returns 201 with the saved collection:
Filtering search results by collection
Once a collection exists, drop its ID into any search on the matching entity type using thecollection: filter:
/works, /authors, /sources, /institutions, /topics, /sdgs,
/funders, /publishers, /keywords, /concepts — as long as the collection
and the endpoint match. Filtering an authors collection on /works returns
a 400:
Negation
Prepend! to exclude the entities in the collection instead of including them:
Limits
- One
collection:filter per request. Repeated or|-OR’d collection values return a400. To combine collections, snapshot the resolved IDs client-side and pass them via theopenalex:filter. - Per-request entity-list ceiling: 10,000. With the per-collection cap of 1,000 entities, a single collection is always within budget.
- Authentication required. Pass your OpenAlex API key in the
Authorization: Bearer …header. Anonymous requests return401; requests by a user who doesn’t own the collection return403.
Filtering by a collection on a related entity
Thecollection: filter above matches a collection against the endpoint of the
same type — a sources collection on /sources, an authors collection on
/authors. But collections are often most useful across types: filtering
one kind of entity by a collection of a different kind.
Any filter field whose value is an OpenAlex ID also accepts a col_…
collection of the matching type. OpenAlex resolves the collection to its member
IDs at query time and matches that field against them — so the collection ID
behaves exactly like a value for that field.
Example — the library-subscription workflow. A librarian builds a sources
collection of the ~1,000 journal IDs in their Elsevier (or Wiley, Springer, …)
package, then filters works by it through the primary_location.source.id
field:
This covers the ID-valued fields on
/works, /authors, /sources, and
/institutions — including author and institution fields such as
last_known_institutions.id and affiliations.institution.id.
Type matching
The collection’s type must match the type the filter field expects. Asources
collection works on primary_location.source.id but not on
authorships.author.id; a mismatch returns a 400 naming both sides:
Negation
Prepend! to the collection ID to exclude its members, just like any other
filter value:
Limits
- One collection per filter field. You can’t OR two collections onto the
same field (
field:col_a|col_b) or repeat the field with a second collection — either returns a400. Use one collection per field; different fields in the same request can each carry their own collection. - Don’t mix a collection with literal IDs in one clause.
primary_location.source.id:col_…|S12345returns a400. Pass the collection alone, or pass literal IDs alone. - The per-collection cap of 1,000 entities still applies, and a single request resolves to at most 10,000 entity IDs across all of its collection filters.
Managing collections
All endpoints below live onuser.openalex.org and require your OpenAlex API key in the Authorization: Bearer header.
Anonymous requests return 401; requests for a collection owned by another
user return 403 (admins bypass this).
List your collections
?page= and ?per_page= (max 100). Pass ?entity_id=W2755968057 to
filter to collections that contain a specific entity — used by the
collection-chip strip on entity pages in the OpenAlex UI.
Response:
Get a single collection
results above. The collection’s
entities are paged separately to keep response sizes bounded:
entity_ids (max
per_page=200).
Update name, description, or entity type
entity_type can be changed only while the collection is empty.
Delete a collection
{"deleted_collection_id": "col_…"}. All collection_entities rows
cascade-delete.
Add or remove entities
{ "added": N, "already_present": M, "rejected_wrong_type": 0 }.
Wrong-type IDs (e.g. an A… in a works collection) fast-fail with 400
naming the first offender, so rejected_wrong_type is always 0 on
success — it’s preserved in the response shape for backward compatibility.
Admin endpoints
OpenAlex admins can list, read, edit, or delete any user’s collection:
Non-admin callers get
403.