Skip to content

Commit

Permalink
fix #43: default Partner's API URL
Browse files Browse the repository at this point in the history
This changes Partner's default URL, replacing calls to the old API with calls to the new one (Academic Graph).
  • Loading branch information
danielnsilva committed Nov 25, 2022
1 parent a27da4d commit 692d1c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions semanticscholar/SemanticScholar.py
Expand Up @@ -12,7 +12,7 @@ class SemanticScholar:
'''

DEFAULT_API_URL = 'https://api.semanticscholar.org/graph/v1'
DEFAULT_PARTNER_API_URL = 'https://partner.semanticscholar.org/v1'
DEFAULT_PARTNER_API_URL = 'https://partner.semanticscholar.org/graph/v1'

auth_header = {}

Expand All @@ -35,13 +35,14 @@ def __init__(
self.api_url = api_url
else:
self.api_url = self.DEFAULT_API_URL
if not graph_api:
self.api_url = self.api_url.replace('/graph', '')

if api_key:
self.auth_header = {'x-api-key': api_key}
if not api_url:
self.api_url = self.DEFAULT_PARTNER_API_URL

if not graph_api:
self.api_url = self.api_url.replace('/graph', '')

self._timeout = timeout
self._requester = ApiRequester(self._timeout)
Expand Down

0 comments on commit 692d1c7

Please sign in to comment.