async def api_request(self, url, params):
request = None<EOL>try:<EOL><INDENT>with async_timeout.timeout(DEFAULT_TIMEOUT, loop=self._event_loop):<EOL><INDENT>request = await self._api_session.get(<EOL>url, params=params)<EOL><DEDENT>if request.status != <NUM_LIT:200>:<EOL><INDENT>_LOGGER.error('<STR_LIT>', request.status)<EOL>return None<EOL><DEDENT>request_json = await request.json()<EOL>if '<STR_LIT:error>' in request_json:<EOL><INDENT>_LOGGER.error('<STR_LIT>',<EOL>request_json['<STR_LIT:error>']['<STR_LIT:code>'],<EOL>request_json['<STR_LIT:error>']['<STR_LIT:message>'])<EOL>return None<EOL><DEDENT>return request_json<EOL><DEDENT>except (aiohttp.ClientError, asyncio.TimeoutError,<EOL>ConnectionRefusedError) as err:<EOL><INDENT>_LOGGER.error('<STR_LIT>', err)<EOL>return None<EOL><DEDENT>
Make api fetch request.