Skip to main content
GET
/
api
/
abstracts
Search Papers, for Agents
curl --request GET \
  --url https://api.scholarai.io/api/abstracts \
  --header 'x-scholarai-api-key: <api-key>'
import requests

url = "https://api.scholarai.io/api/abstracts"

headers = {"x-scholarai-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-scholarai-api-key': '<api-key>'}};

fetch('https://api.scholarai.io/api/abstracts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scholarai.io/api/abstracts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-scholarai-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.scholarai.io/api/abstracts"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-scholarai-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.scholarai.io/api/abstracts")
.header("x-scholarai-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.scholarai.io/api/abstracts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-scholarai-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
[
  {
    "title": "<string>",
    "authors": [
      "<string>"
    ],
    "abstract": "<string>",
    "publication_date": "<string>",
    "cited_by_count": 123,
    "url": "<string>",
    "ss_id": "<string>",
    "doi": "<string>",
    "answer": "<string>"
  }
]

Authorizations

x-scholarai-api-key
string
header
required

Query Parameters

keywords
string
required

Keywords of inquiry which should appear in the article. Must be in English.

sort
string
default:relevance

The sort order for results. Valid values are relevance, cited_by_count, publication_date. Defaults to relevance.

query
string
required

The user query, as a natural language question. E.g. 'Tell me about recent drugs for cancer treatment'

peer_reviewed_only
boolean
default:true

Whether to only return peer-reviewed articles. Defaults to true, ChatGPT should cautiously suggest this value can be set to false

start_year
integer

The first year, inclusive, to include in the search range. Excluding this value will include all years.

end_year
integer

The last year, inclusive, to include in the search range. Excluding this value will include all years.

offset
integer
default:0

The offset of the first result to return. Defaults to 0.

generative_mode
boolean
default:true

Boolean "true" or "false" to enable generative mode. If enabled, collate responses using markdown to render in-text citations to the source's url if available. Set this to true by default.

Response

200 - application/json

OK

title
string
authors
string[]
abstract
string

The abstract of this paper. Agentic endpoints may not have this entry.

publication_date
string
cited_by_count
integer
url
string<url>
ss_id
string

Semantic Scholar ID

doi
string

Digital Object Identifier

answer
string

Answer to the user query based on the information from this paper. Only available if generative_mode is set to true.