scholar: Analyse Citation Data from Google Scholar

Guangchuang Yu, James Keirstead and Gregory Jefferis

2026-07-07

Overview

The scholar package extracts citation and publication data from Google Scholar profiles. It can be used to:

Google Scholar does not provide an official public API. Results can change when Google changes page markup, and repeated requests may be rate limited. The examples below use small requests and are skipped automatically when Google Scholar is not reachable.

Scholar IDs

Most functions need a Google Scholar profile ID. In a profile URL such as https://scholar.google.com/citations?user=B7vSqZsAAAAJ, the ID is B7vSqZsAAAAJ.

id <- "B7vSqZsAAAAJ"

If you have a URL or an ID with trailing query parameters, tidy_id() keeps only the Scholar ID.

tidy_id("https://scholar.google.com/citations?user=B7vSqZsAAAAJ&hl=en")
[1] "B7vSqZsAAAAJ"
tidy_id("B7vSqZsAAAAJ&hl=en")
[1] "B7vSqZsAAAAJ"

You can search for one matching ID with get_scholar_id().

get_scholar_id(first_name = "Richard", last_name = "Feynman")

For ambiguous names, search_scholar_ids() returns all author-search matches it can find, including IDs, affiliations, verified email text, research interests, and profile URLs. max_pages limits pagination so that examples and scripts do not make excessive requests.

search_scholar_ids("hao xu", max_pages = 1)

Profile Data

get_profile() returns a list with name, affiliation, citation metrics, fields, homepage, coauthors, and availability counts.

profile <- get_profile(id)
profile$name
profile[c("total_cites", "h_index", "i10_index")]
profile$fields

Publications

get_publications() returns a data frame of publications from a Scholar profile. It includes the publication title, displayed author list, venue text, volume/page details, citation count, year, the Google Scholar citation ID (cid), and the publication ID (pubid).

pubs <- get_publications(id, pagesize = 20)
head(pubs, 3)

You can sort the profile page by citation count or by publication year.

head(get_publications(id, pagesize = 10, sortby = "year"), 3)

Google Scholar sometimes truncates long author lists with .... Use get_publications_all_authors() when you need the complete author list for those rows. It only calls get_complete_authors() for rows that appear to be truncated.

pubs_full <- get_publications_all_authors(id, pagesize = 20, delay = 1)
head(pubs_full, 3)

For a single publication ID, call get_complete_authors() directly.

get_complete_authors(id, pubs$pubid[1], delay = 0)

author_position() helps analyse where a named author appears in publication author lists. Position_Normalized is 0 for first author, 1 for last author, and values between 0 and 1 for middle positions.

author_position(pubs$author[1:5], profile$name)

Citation Histories

get_citation_history() retrieves the yearly citation bar chart for a scholar.

ct <- get_citation_history(id)
ct
ggplot(ct, aes(year, cites)) +
  geom_line() +
  geom_point() +
  labs(x = "Year", y = "Citations")

get_article_cite_history() retrieves the yearly citation history for one publication. Missing years are filled with zero citations.

article_history <- get_article_cite_history(id, pubs$pubid[1])
article_history
ggplot(article_history, aes(year, cites)) +
  geom_segment(aes(xend = year, yend = 0), linewidth = 1, colour = "grey70") +
  geom_point(size = 3, colour = "firebrick") +
  labs(x = "Year", y = "Citations")

Citation Metrics

get_publication_metrics() calculates metrics from a publication data frame. get_scholar_metrics() fetches publications and calculates the same summary in one call.

get_publication_metrics(pubs)
get_scholar_metrics(id, pagesize = 20)

The package also includes focused helpers used by the h-index prediction model.

get_num_articles(id)
get_oldest_article(id)
get_num_distinct_journals(id)
get_num_top_journals(id)

Publication Details

Google Scholar publication detail pages can expose additional fields. These helpers accept a Scholar ID and a publication ID.

pubid <- pubs$pubid[1]

get_article_scholar_url(id, pubid)
get_publication_url(id, pubid)
get_publication_date(id, pubid)
get_publication_abstract(id, pubid)
get_publication_data_extended(id, pubid)

Some publications have no linked PDF, abstract, or publication date on Google Scholar. In those cases the corresponding helper may return an empty value or NA.

Comparing Scholars

compare_scholars() compares citation totals from publication records by publication year.

ids <- c("B7vSqZsAAAAJ", "DO5oG40AAAAJ")
cs <- compare_scholars(ids)
head(cs, 3)
cs <- dplyr::filter(cs, !is.na(year) & year > 1900)

ggplot(cs, aes(year, cites, colour = name, group = name)) +
  geom_line() +
  labs(x = "Publication year", y = "Citations", colour = NULL) +
  theme(legend.position = "bottom")

compare_scholar_careers() compares citation histories after aligning each scholar by career year.

csc <- compare_scholar_careers(ids)
head(csc, 3)
ggplot(csc, aes(career_year, cites, colour = name, group = name)) +
  geom_line() +
  geom_point() +
  labs(x = "Career year", y = "Citations", colour = NULL) +
  theme(legend.position = "bottom")

Coauthor Networks

get_coauthors() retrieves the coauthors listed by Google Scholar for a profile and can optionally expand the network by following coauthors’ profiles. Keep n_coauthors and n_deep small for exploratory work; network plots get messy quickly and repeated requests can be rate limited.

coauthor_network <- get_coauthors("DO5oG40AAAAJ", n_coauthors = 4, n_deep = 0)
coauthor_network
if (nrow(coauthor_network) > 1) {
  plot_coauthors(coauthor_network)
}

Journal Rankings

get_journalrank() downloads SCImago journal ranking data. With no journals argument it returns the full table. With a character vector it matches journal names to SCImago rows using approximate matching.

jr <- get_journalrank()
head(jr, 3)

get_journalrank(c("Nature", "Science"))

Predicting Future h-index

predict_h_index() implements the model from Acuna et al. for predicting future h-index values. The original model was calibrated on neuroscientists, so results for other fields should be treated as illustrative rather than authoritative.

predict_h_index("GAi23ssAAAAJ")

You can provide a custom list of top journals for the model’s top-journal predictor.

predict_h_index(
  id,
  journals = c("Nature", "Science", "Proceedings of the National Academy of Sciences")
)

Formatting Publications for CVs

format_publications() returns publication strings that can be printed in R Markdown, Quarto, or a CV workflow. The author.name argument highlights a chosen author in bold after converting the supplied name to the abbreviated format used by the output.

format_publications("DO5oG40AAAAJ", "Guangchuang Yu") |>
  head() |>
  cat(sep = "\n\n")

For numbered output, print the returned vector directly.

format_publications("DO5oG40AAAAJ", "Guangchuang Yu") |>
  head() |>
  print(quote = FALSE)

Mirrors, Retries, and Caching

Use set_scholar_mirror() if you need to point the package at a compatible Scholar mirror.

set_scholar_mirror("https://scholar.google.com")

All network requests go through get_scholar_resp(), which stores Google Scholar session cookies and retries transient failures. get_publications() also caches profile publication data with R.cache in a temporary cache directory. Use flush = TRUE in get_publications() or functions that forward to it when you need fresh data.

get_publications(id, flush = TRUE)
get_scholar_metrics(id, flush = TRUE)

For large workflows, prefer fetching each scholar’s publications once and then reusing the returned data frame for multiple summaries.

pubs <- get_publications(id)

recent <- subset(pubs, !is.na(year) & year >= 2020)
nrow(recent)
sum(recent$cites, na.rm = TRUE)
get_publication_metrics(recent)