$npx -y skills add ai4protein/VenusFactory2 --skill openalexOpenAlex — free, comprehensive scholarly graph (works, authors, sources/journals, institutions, topics, concepts, funders). Search papers by keyword/filter/sort, fetch a single entity by ID, look up author profiles, institutions, citation networks. Use whenever the user asks abou
| 1 | # OpenAlex |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | OpenAlex is a free index of >250M scholarly works built atop the Microsoft Academic Graph's successor. No API key required for the polite pool. Optional `OPENALEX_EMAIL` / `USER_EMAIL` env var → priority routing; `OPENALEX_API_KEY` env var → premium pool with higher limits. |
| 6 | |
| 7 | ## Project Tools (VenusFactory2) |
| 8 | |
| 9 | | Tool | Args | Returns | Description | |
| 10 | |------|------|---------|--------------| |
| 11 | | **download_openalex_entries_by_query** | `entity_type` (required: `works` \| `authors` \| `sources` \| `institutions` \| `topics` \| `concepts` \| `publishers` \| `funders` \| ...), `out_dir`, `search` (free-text keyword), `filter_expr` (OpenAlex filter syntax, e.g. `authorships.author.id:A123,publication_year:>2020`), `sort` (e.g. `cited_by_count:desc`), `per_page` (default 25, max 200), `page` (default 1), `timeout` | rich JSON envelope; saved JSON page at `file_info.file_path`; `biological_metadata.total_count` + `result_count` + `next_page` hint | Search OpenAlex. | |
| 12 | | **download_openalex_entry_by_id** | `entity_type`, `openalex_id` (e.g. `W3177828909`, `A5089215617`, or full openalex.org URL), `out_dir`, `timeout` | rich JSON envelope; full entity JSON at `file_info.file_path`; `biological_metadata` extracts `display_name`, `cited_by_count`, `publication_year`, `doi` | Fetch a single entity by ID. | |
| 13 | |
| 14 | ## When to Use This Skill |
| 15 | |
| 16 | - "Find papers about X" / "what's the most cited paper on Y" → search `works` with `sort=cited_by_count:desc` |
| 17 | - "Who is the most prolific author in topic X" → search `authors` with `filter_expr=topics.id:T...` |
| 18 | - "Get me the full record for [DOI/work ID]" → `download_openalex_entry_by_id` on `works` |
| 19 | - "What's institution X publishing about lately" → search `works` with `filter_expr=authorships.institutions.id:I...,publication_year:2024` |
| 20 | |
| 21 | ## Filter Syntax Cheatsheet |
| 22 | |
| 23 | Filters are comma-separated for AND, `|` inside a value for OR. Examples: |
| 24 | |
| 25 | | Filter | Effect | |
| 26 | |---|---| |
| 27 | | `publication_year:2023` | exact year | |
| 28 | | `publication_year:>2020` | year > 2020 | |
| 29 | | `from_publication_date:2023-01-01` | inclusive lower bound | |
| 30 | | `cited_by_count:>100` | well-cited papers | |
| 31 | | `authorships.author.id:A5089215617` | papers by a given author | |
| 32 | | `authorships.institutions.id:I4210090411` | papers from a given institution (`I4210090411` = DeepMind) | |
| 33 | | `topics.id:T11444` | papers in a specific topic | |
| 34 | | `is_oa:true` | open access only | |
| 35 | | `type:journal-article` | filter by work type | |
| 36 | | `doi:10.1038/s41586-021-03819-2` | exact DOI lookup | |
| 37 | |
| 38 | ## ID Prefixes |
| 39 | |
| 40 | - `W` = Work (paper) |
| 41 | - `A` = Author |
| 42 | - `S` = Source (journal/conference/book/repo) |
| 43 | - `I` = Institution |
| 44 | - `T` = Topic |
| 45 | - `C` = Concept |
| 46 | - `P` = Publisher |
| 47 | - `F` = Funder |
| 48 | |
| 49 | ## Pagination |
| 50 | |
| 51 | - Set `per_page` ≤ 200 and walk `page=1, 2, ...` until `biological_metadata.next_page` is `None`. |
| 52 | - For deep paging (>10k results), use OpenAlex's cursor pagination instead — out of scope for this tool; download the first page, inspect `meta.next_cursor`, then drive the cursor manually. |
| 53 | |
| 54 | ## Common Mistakes |
| 55 | |
| 56 | - **`per_page=1000`**: max is 200. Set to 200 then paginate. |
| 57 | - **Wrong entity prefix**: `download_openalex_entry_by_id(entity_type='works', openalex_id='A123...')` will 404 — the prefix `A` says author, not work. |
| 58 | - **Filtering without an entity context**: `filter_expr=author.id:A123` makes no sense for `entity_type=authors` (use `id:A123` instead). |
| 59 | - **Free-text vs filter confusion**: `search="cited_by_count desc"` won't sort — use the `sort` parameter. |
| 60 | |
| 61 | ## References |
| 62 | |
| 63 | - [OpenAlex docs](https://docs.openalex.org/) |
| 64 | - [Entity-type filter ref](https://docs.openalex.org/api-entities/works/filter-works) (one page per entity type) |
| 65 | - [Get an OpenAlex API key](https://openalex.org/) (optional) |