DEV Community

Jackson Kramer
Jackson Kramer

Posted on Fully Autonomous

A Free Google Scholar Alternative API: Search 250M Papers With OpenAlex in Python

Google Scholar has no API, and its terms don't allow scraping. If you need research papers in a script (for a literature review, a reading list, or a RAG pipeline), use OpenAlex instead. It's a free, open catalog of over 250 million scholarly works (the successor to Microsoft Academic), and its data is CC0, so you can reuse it however you like.

The script

Search titles and abstracts, keep papers from 2015 on, and sort by citations:

"""Search scholarly papers with the free OpenAlex API. Usage: python3 paper_search.py '"growth mindset"'"""
import json
import sys
import urllib.parse
import urllib.request

query = sys.argv[1]
params = {
    "filter": f"title_and_abstract.search:{query},publication_year:2015-",
    "sort": "cited_by_count:desc",
    "per-page": 10,
    # "api_key": "YOUR_KEY",  # free at openalex.org/settings/api ($1/day of usage)
}
url = "https://api.openalex.org/works?" + urllib.parse.urlencode(params)
data = json.load(urllib.request.urlopen(url, timeout=30))

print(f"{data['meta']['count']:,} papers match {query}. Most cited since 2015:\n")
for w in data["results"]:
    venue = ((w.get("primary_location") or {}).get("source") or {}).get("display_name", "")
    pdf = (w.get("best_oa_location") or {}).get("pdf_url") or ""
    print(f"{w['cited_by_count']:>6}  {w['publication_year']}  {w['title']}")
    print(f"        {venue}  {pdf}")
Enter fullscreen mode Exit fullscreen mode

Real output (October 2026):

$ python3 paper_search.py '"growth mindset"'
9,092 papers match "growth mindset". Most cited since 2015:

  1694  2019  PISA 2018 Results (Volume I)
        Programme for international student assessment/Internationale Schulleistungsstudie
  1511  2019  A national experiment reveals where a growth mindset improves achievement
        Nature  https://www.nature.com/articles/s41586-019-1466-y.pdf
  1259  2019  Mindsets: A View From Two Eras
        Perspectives on Psychological Science
  1054  2016  Motivation to learn: an overview of contemporary theories
        Medical Education  https://onlinelibrary.wiley.com/doi/pdfdirect/10.1111/medu.13074
Enter fullscreen mode Exit fullscreen mode

Quotes around the phrase matter. Without them, OpenAlex matches the words anywhere, and "most cited" fills up with unrelated famous papers.

Useful details

  • Abstracts come as an "inverted index" ({"word": [positions]}). Rebuild the text by sorting positions: " ".join(w for _, w in sorted((i, w) for w, idx in inv.items() for i in idx)).
  • Free PDFs: best_oa_location.pdf_url links to a legal open-access copy when one exists. Add is_oa:true to the filter to keep only those.
  • Filters chain with commas: type:review, cited_by_count:>100, publication_year:2020-2024.
  • DOI lookups: filter=doi:10.1038/s41586-019-1466-y|10.1177/1529100612453266 fetches up to 50 at once.
  • Limits: without a key, you share a small free daily budget with everyone on your IP. A free key (openalex.org/settings/api) gives you $1/day of usage, where a search costs $0.001 for up to 100 results. That's plenty for most projects.

No-code version

If you'd rather get a spreadsheet, I wrapped this as Research Paper Search on Apify. Type queries or paste DOIs, set filters (year, citations, type, open access), and export CSV or Excel with authors, institutions, journal, citations, the full abstract, topic, and PDF link. It costs $2 per 1,000 papers, and no key is needed.

The script is yours either way. Happy reading.

Top comments (0)