from typing import Dict
from typing import Any
import requests


def semanticscholar(identifier: str, include_unknown_references: bool = False) -> Dict[str, Any]:
	"""
	Retrieve information from the Semantic Scholar API.

	The identifier can be a DOI or the Semantic Scholar paper ID.

	See: https://api.semanticscholar.org
	"""

	url = f'https://api.semanticscholar.org/v1/paper/{identifier}'
	params: Dict[str, Any] = dict()
	if include_unknown_references:
		params['include_unknown_references'] = 'true'
	response = requests.get(url, params=params)
	response.raise_for_status
	return response.json()