Registry / search / semanticscholar

semanticscholar

JSON →
library0.12.0pypypi✓ verified 84d ago

Unofficial Python client for the Semantic Scholar API. Version 0.12.0 requires Python >=3.10. Provides async and sync access to paper search, author data, citations, and recommendations. Release cadence is irregular, typically several months.

pip install semanticscholar
INSTALL
IMPORT
SIG · SEMANTICSCHOLAR
S
semanticscholar
searchpythonv0.12.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SemanticScholar
from semanticscholar import SemanticScholar
import semanticscholar
Importing the module directly does not expose the class; you must import the class explicitly.
AsyncSemanticScholar
from semanticscholar import AsyncSemanticScholar
Async variant requires same explicit import.

Search for papers by title or keyword. Returns a list of Paper objects.

from semanticscholar import SemanticScholar sch = SemanticScholar() results = sch.search_paper('Transformer') print(results[0].title)
Debug
Known issues
breakingIn version 0.10.0, the `paper_id` parameter in `get_paper()` was changed from a single string to a list of strings. Existing code passing a single string without a list wrapper will break.
fix
Pass paper IDs as a list: `sch.get_paper(['CorpusID:12345'])` or use `sch.get_paper('12345')` for single ID if you upgrade to the new API.
affects: >=0.10.0
breakingThe `details` parameter in `search_paper()` was changed from a boolean to a list of strings in version 0.10.0.
fix
Replace `details=True` with `details=['abstract', 'tldr']` or similar list.
affects: >=0.10.0
gotchaRate limits: The Semantic Scholar API enforces a rate limit of 1 request per second without an API key. Exceeding this may result in HTTP 429 errors.
fix
Pass your API key via `SemanticScholar(api_key='YOUR_KEY')` to get higher limits (100 req/s). Or use `time.sleep(1)` between calls.
affects: all
deprecatedThe `from_s2id` class method on `Paper` is deprecated in favor of using `SemanticScholar.get_paper()`.
fix
Replace `Paper.from_s2id('...')` with `sch.get_paper(['...'])`.
affects: >=0.12.0
Errors
Common errors & fixes
AttributeError: module 'semanticscholar' has no attribute 'SemanticScholar'
Importing the module instead of the class.
fix
Use: `from semanticscholar import SemanticScholar`
TypeError: get_paper() takes 1 positional argument but 2 were given
In older versions, `get_paper()` expects a single string, not multiple arguments. After 0.10.0, it expects a list.
fix
If using version <0.10.0: `sch.get_paper('CorpusId:12345')`. If >=0.10.0: `sch.get_paper(['CorpusId:12345'])`.
semanticscholar.SemanticScholarError: 429 Too Many Requests
Exceeded API rate limit.
fix
Add an API key: `SemanticScholar(api_key='YOUR_KEY')` or slow down requests with `time.sleep(1)`.
Upgrade
Version history
0.12.0latest on PyPI · released Mar 29, 2026
Audit
Dependencies
httpxrequiredHTTP client for API requests
pydanticrequiredData validation and parsing
Agent activity
46 hits · last 30 days
node
42
Resources
semanticscholar — pip install semanticscholar · libregistry