From eee1df95ecff9267dca95465f49702be33d831a4 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 2 Nov 2021 09:55:06 -0500 Subject: [PATCH] Fix API URL definition issue --- semanticscholar/SemanticScholar.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/semanticscholar/SemanticScholar.py b/semanticscholar/SemanticScholar.py index 506803c..5555fdd 100644 --- a/semanticscholar/SemanticScholar.py +++ b/semanticscholar/SemanticScholar.py @@ -25,16 +25,16 @@ def __init__( :param str api_url: (optional) custom API url. ''' - if api_key: - self.auth_header = {'x-api-key': api_key} - if not api_url: - self.api_url = self.DEFAULT_PARTNER_API_URL - if api_url: self.api_url = api_url else: self.api_url = self.DEFAULT_API_URL + if api_key: + self.auth_header = {'x-api-key': api_key} + if not api_url: + self.api_url = self.DEFAULT_PARTNER_API_URL + self.timeout = timeout def paper(self, id: str, include_unknown_refs: bool=False) -> dict: