OpenAlex is based on 7 types of units (entities): W(ork), A(uthor), S(ource), I(nstitution), C(oncept), P(ublisher), or F(under)
Get the work with this DOI: https://doi.org/10.1007/s11192-012-0940-1 . In a web browser
https://api.openalex.org/works/https://doi.org/10.1007/s11192-012-0940-1
or in R
> wd <- GET("https://api.openalex.org/works/https://doi.org/10.1007/s11192-012-0940-1") > wc <- fromJSON(rawToChar(wd$content)) > names(wc) [1] "id" "doi" "title" [4] "display_name" "publication_year" "publication_date" [7] "ids" "language" "primary_location" [10] "type" "type_crossref" "indexed_in" [13] "open_access" "authorships" "countries_distinct_count" [16] "institutions_distinct_count" "corresponding_author_ids" "corresponding_institution_ids" [19] "apc_list" "apc_paid" "has_fulltext" [22] "fulltext_origin" "cited_by_count" "cited_by_percentile_year" [25] "biblio" "is_retracted" "is_paratext" [28] "primary_topic" "topics" "keywords" [31] "concepts" "mesh" "locations_count" [34] "locations" "best_oa_location" "sustainable_development_goals" [37] "grants" "referenced_works_count" "referenced_works" [40] "related_works" "ngrams_url" "abstract_inverted_index" [43] "cited_by_api_url" "counts_by_year" "updated_date" [46] "created_date" > > wc$id [1] "https://openalex.org/W2083084326" > wc$title [1] "On bibliographic networks"
The work https://openalex.org/W2083084326 has the OpenAlex ID W2083084326 .
https://api.openalex.org/works/W2083084326?select=id,title,countries_distinct_count,cited_by_count,referenced_works_count
{ id: "https://openalex.org/W2083084326", title: "On bibliographic networks", countries_distinct_count: 1, cited_by_count: 124, referenced_works_count: 10 }
> select="id,title,countries_distinct_count,cited_by_count,referenced_works_count" > wd <- GET(paste(works,"/W2083084326",sep=""),query=list(select=select)) > wd$status_code [1] 200 > wc <- fromJSON(rawToChar(wd$content)) > names(wc) [1] "id" "title" "countries_distinct_count" [4] "cited_by_count" "referenced_works_count" > wc $id [1] "https://openalex.org/W2083084326" $title [1] "On bibliographic networks" $countries_distinct_count [1] 1 $cited_by_count [1] 124 $referenced_works_count [1] 10
Using search
we can search for a given search text across titles, abstracts, and fulltext. Using filter
we can limit our search to works satisfying given conditions. Using select
we can select data that will appear in results.
For example:
produces a list of works on handball published in the year 2015
{ meta: { count: 1275, db_response_time_ms: 216, page: 1, per_page: 25, groups_count: null }, results: [ { id: "https://openalex.org/W1971587050", title: "Improving Fitness of Elite Handball Players", countries_distinct_count: 1, cited_by_count: 74, referenced_works_count: 29 }, { id: "https://openalex.org/W2218176234", title: "Incidence and risk factors of injuries in Brazilian elite handball players: A prospective cohort study", countries_distinct_count: 2, cited_by_count: 89, referenced_works_count: 25 }, { id: "https://openalex.org/W2133414068", title: "Injury and illness surveillance during the 24th Men's Handball World Championship 2015 in Qatar", countries_distinct_count: 3, cited_by_count: 85, referenced_works_count: 39 }, { id: "https://openalex.org/W2014565141", title: "Technical Match Characteristics and Influence of Body Anthropometry on Playing Performance in Male Elite Team Handball", countries_distinct_count: 2, cited_by_count: 73, referenced_works_count: 8 }, ...
In R. The OpenAlex API uses paging - the list data are provided by pages. The basic paging (up to 10 000 units) is based on two parameters page
and per_page
)
> wd <- GET("https://api.openalex.org/works", + query = list( + search="handball", + filter="publication_year:2015", + select="id,title,countries_distinct_count,cited_by_count,referenced_works_count", + page="2", per_page="200")) > names(wd) [1] "url" "status_code" "headers" "all_headers" "cookies" "content" "date" [8] "times" "request" "handle" > wc <- fromJSON(rawToChar(wd$content)) > names(wc) [1] "meta" "results" "group_by" > names(wc$meta) [1] "count" "db_response_time_ms" "page" "per_page" [5] "groups_count" > wc$meta$count [1] 1276 > wc$meta$page [1] 2 > str(wc$results) 'data.frame': 200 obs. of 5 variables: $ id : chr "https://openalex.org/W1231051419" "https://openalex.org/W2052283707" ... $ title : chr "Simultaneous bilateral tibial stress fractures in a handball player." ... $ countries_distinct_count: int 0 1 1 1 1 2 0 0 0 0 ... $ cited_by_count : int 0 0 0 0 7 3 0 0 0 0 ... $ referenced_works_count : int 0 9 6 29 28 0 0 0 0 0 ...
Cursor paging is a bit more complicated than basic paging, but it allows us to access as many records as we like.
> works <- "https://api.openalex.org/works" > Q <- list( + search="handball", + filter="publication_year:2015", + select="id,title,countries_distinct_count,cited_by_count,referenced_works_count", + per_page="200", + cursor="*" + ) > k <- 0 > while(k<30){ + wd <- GET(works,query=Q) + if(wd$status_code!=200) break + k <- k+1 + wc <- fromJSON(rawToChar(wd$content)) + Q$cursor <- wc$meta$next_cursor + if(is.null(Q$cursor)) break + df <- wc$results; nr <- nrow(df) + cat(k,wc$meta$count,nr,"\n ",Q$cursor,"\n ") + if(nr>0){ # use current page data + cat(df$title[1],"\n"); flush.console() + } + } 1 1280 200 IlsyOC44NTQ1MjcsIDE0NDkxODcyMDAwMDAsICdodHRwczovL29wZW5hbGV4Lm9yZy9XMjc3MTAyMjYxMCddIg== Improving Fitness of Elite Handball Players 2 1280 200 IlsxMS4yNDU0NjIsIDE0MzEwNDMyMDAwMDAsICdodHRwczovL29wZW5hbGV4Lm9yZy9XMTg3NTYxODYwNiddIg== Application of the Multidimensional Inventory of Sport Excelence on the samples of young top female handball and volleyball players 3 1280 200 Ils2LjYwMTYxOCwgMTQyMjc0ODgwMDAwMCwgJ2h0dHBzOi8vb3BlbmFsZXgub3JnL1cxOTY2MjYwODIyJ10i The effect of heavy resistance exercise on repeated sprint performance in youth athletes 4 1280 200 Ils0LjgyMTYzMiwgMTQyMjQwMzIwMDAwMCwgJ2h0dHBzOi8vb3BlbmFsZXgub3JnL1cyMzM5MTQzNDE2J10i The Effect of Tibial Rotation on the Contribution of Medial and Lateral Hamstrings During Isometric Knee Flexion 5 1280 200 IlszLjMzNTA3NjgsIDE0MjU4NTkyMDAwMDAsICdodHRwczovL29wZW5hbGV4Lm9yZy9XMjE4ODExNTUyNSddIg== Why the Three-Point Rule Failed to Sufficiently Reduce the Number of Draws in Soccer: An Application of Prospect Theory 6 1280 200 IlswLjY3MzE3MzM3LCAxNDIwMDcwNDAwMDAwLCAnaHR0cHM6Ly9vcGVuYWxleC5vcmcvVzIzMzU5OTg3MDQnXSI= THE PHYSICAL FITNESS NORMS OF THAI UNIVERSITY ATHLETES 7 1280 80 IlswLjE3NDczOTk2LCAxNDIwMDcwNDAwMDAwLCAnaHR0cHM6Ly9vcGVuYWxleC5vcmcvVzQyNTEwMzUzMzcnXSI= Risk Factor Analysis of Female Soccer Tournament Players
https://api.openalex.org/works?filter=author.id:A5001676164&select=id,title
{ meta: { count: 248, db_response_time_ms: 81, page: 1, per_page: 25, groups_count: null }, results: [ { id: "https://openalex.org/W4291733759", title: "Exploratory Social Network Analysis with Pajek" }, { id: "https://openalex.org/W1947595544", title: "Exploratory Social Network Analysis with Pajek" }, { id: "https://openalex.org/W1424846356", title: "Exploratory Social Network Analysis with Pajek" }, { id: "https://openalex.org/W2147991930", title: "Fast algorithms for determining (generalized) core groups in social networks" }, ... { id: "https://openalex.org/W2096814473", title: "Visual Analysis of Large Graphs Using (X,Y)-Clustering and Hybrid Visualizations" }, { id: "https://openalex.org/W3037530667", title: "Generalized Cores" } ], group_by: [ ] }
My ORCID number is 0000-0002-0240-9446. To get data about me
> ad <- GET("https://api.openalex.org/authors/orcid:0000-0002-0240-9446") > names(ad) [1] "url" "status_code" "headers" "all_headers" "cookies" "content" "date" [8] "times" "request" "handle" > ad$status_code [1] 200 > ac <- fromJSON(rawToChar(ad$content)) > names(ac) [1] "id" "orcid" "display_name" [4] "display_name_alternatives" "works_count" "cited_by_count" [7] "summary_stats" "ids" "affiliations" [10] "last_known_institution" "last_known_institutions" "x_concepts" [13] "counts_by_year" "works_api_url" "updated_date" [16] "created_date" > ac
The results are available at orcid:0000-0002-0240-9446. We learn that my OpenAlex ID is A5001676164.
In my affiliations appear two phantom institutions:
https://api.openalex.org/works?filter=publication_year:1984,authorships.author.id:A5001676164
Department of Mathematics, Edvard Kardelj University, 61000 Igubljana, Yugoslavia
https://api.openalex.org/works?filter=publication_year:1982,authorships.author.id:A5001676164
Faculty of Sociology, Political Sciences and Journalism, University Edvard Kardelj, Kardeljeva ploščad 5, 61000, Ljubljana, Yugoslavia
Kardelj ?→? Karde
> ad <- GET("https://api.openalex.org/authors?search=Vladimir%20Batagelj") > names(ad) [1] "url" "status_code" "headers" "all_headers" "cookies" "content" "date" [8] "times" "request" "handle" > ac <- fromJSON(rawToChar(ad$content)) > names(ac) [1] "meta" "results" "group_by" > str(ac)