agentleFS
Barrios88Barrios88/barrios-skills/skills/research-tools/openalex-api/SKILL.md

openalex-api

Skill63 starsChanged 5 months agoMITView on GitHub

Access and analyze OpenAlex scholarly metadata through the REST API, including works, authors, institutions, sources, concepts, topics, funders, and publishers. Use when asked to retrieve publication or citation metadata, run OpenAlex searches with filters, map author-institution relationships, or build reproducible bibliometric datasets from OpenAlex.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill to turn research questions into reliable OpenAlex API queries and structured outputs.

    line 13
  2. Very specific:

    Use repeated --filter flags for AND logic.

    line 25
  3. Very specific:

    Use OpenAlex pipe syntax (for example value1|value2) inside one filter for OR logic.

    line 26
  4. Very specific:

    Use --select to reduce payload size for large pulls.

    line 27
  5. Very specific:

    Use --cursor '*' for deep paging beyond basic page limits.

    line 28
  6. Very specific:

    Use OPENALEX_API_KEY or --api-key when available for higher-rate access.

    line 30
  7. Distinctive:

    Prefer JSON for full response bundles and JSONL for row-wise pipelines.

    line 58
  8. Very specific:

    Keep original IDs (id, ids.openalex, DOI fields) unchanged in exports.

    line 59
  9. Distinctive:

    When reporting findings, cite exact query parameters used to ensure reproducibility.

    line 60
  10. Very specific:

    Use scripts/query_openalex.py for all API calls.

    line 64
  11. Very specific:

    Use references/openalex-query-patterns.md for entity routing, filter templates, and reusable query patterns.

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Barrios Skills — John Barrios's curated workflow for economists and accountants. Prioritize reproducible empirical work, clear identification language, and journal-ready output.

OpenAlex API

Overview

Use this skill to turn research questions into reliable OpenAlex API queries and structured outputs. Prefer scripts/query_openalex.py for repeatable retrieval, pagination, and filter-safe URL construction.

Workflow

  1. Define the target entity: works, authors, institutions, sources, concepts, topics, funders, or publishers.
  2. Define retrieval scope: exact ID lookup, search, or filtered dataset pull.
  3. Build query parameters with scripts/query_openalex.py instead of handcrafting URLs.
  4. Retrieve data to JSON/JSONL and keep the raw export before downstream cleaning.
  5. Validate key fields (IDs, dates, citation counts, authorships) before analysis.

Query Rules

  • Use repeated --filter flags for AND logic.
  • Use OpenAlex pipe syntax (for example value1|value2) inside one filter for OR logic.
  • Use --select to reduce payload size for large pulls.
  • Use --cursor '*' for deep paging beyond basic page limits.
  • Include --mailto you@domain.edu for polite-pool style identification.
  • Use OPENALEX_API_KEY or --api-key when available for higher-rate access.

Common Commands

# Fetch one work by OpenAlex ID
python3 scripts/query_openalex.py works --entity-id W2741809807 --select "id,display_name,publication_year,cited_by_count"

# Search works and save first 200 records
python3 scripts/query_openalex.py works \
  --search "political polarization" \
  --filter "from_publication_date:2020-01-01" \
  --sort "cited_by_count:desc" \
  --per-page 100 \
  --pages 2 \
  --output polarization_works.json

# Cursor-paginate author records to JSONL
python3 scripts/query_openalex.py authors \
  --filter "last_known_institutions.country_code:US" \
  --cursor "*" \
  --max-results 500 \
  --format jsonl \
  --output us_authors.jsonl

Output Guidance

  • Prefer JSON for full response bundles and JSONL for row-wise pipelines.
  • Keep original IDs (id, ids.openalex, DOI fields) unchanged in exports.
  • When reporting findings, cite exact query parameters used to ensure reproducibility.

Resources

  • Use scripts/query_openalex.py for all API calls.
  • Use references/openalex-query-patterns.md for entity routing, filter templates, and reusable query patterns.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.