get_paper

s2.api.get_paper(paperId: str, api_key: Optional[str] = None, session: Optional[requests.sessions.Session] = None, return_json: Optional[bool] = False, retries: Optional[int] = 2, wait: Optional[int] = 150, **kwargs)Union[Dict, s2.models.S2Paper]

Look up information about a paper in Semantic Scholar using requests.Session.get() Returns a S2Paper object describing the paper.

Parameters
  • paperId (str) –

    Semantic Scholar paper identifier or URL.

    Accessible Paper Identifiers and Examples:

    • S2 Paper ID : 0796f6cd7f0403a854d67d525e9b32af3b277331

    • DOI : 10.1038/nrn3241

    • ArXiv ID : arXiv:1705.10311

    • MAG ID : MAG:112218234

    • ACL ID : ACL:W12-3903

    • PubMed ID : PMID:19872477

    • Corpus ID : CorpusID:37220927

  • api_key (str, optional) – A Data Partners API key. Defaults to None

  • session (requests.Session, optional) – A requests.Session object, can be used to store API key (see Using an API Key). Defaults to None

  • return_json (bool, optional) – Return original json from get request (e.g. in case of PyS2-breaking changes to the S2 API). Defaults to False

  • retries (int, optional) – Number of retry attempts after rate limit is exceeded. Defaults to 2

  • wait (int, optional) –

    Number of seconds to wait between retries if rate limit is exceeded (100 per 5 minute window for public API). Defaults to 150. This can be safely lowered with access to the Data Partners API (see Using an API Key)

  • **kwargs (Dict[str, any], optional) – Keyword Args for requests.Session.get(). e.g. to include unknown references use params = dict(include_unknown_references=True). Defaults to {}

Returns

A S2Paper or dict object describing the paper

Return type

dict or S2Paper