Spaces:
No application file
No application file
| import os | |
| import aiohttp | |
| API_KEY = os.getenv("INTELX_API_KEY") | |
| BASE_URL = "https://api.intelx.io" | |
| async def search_intelx(entity: str): | |
| headers = { | |
| "x-key": API_KEY, | |
| "Content-Type": "application/json" | |
| } | |
| payload = { | |
| "term": entity, | |
| "maxresults": 10, | |
| "media": 0 | |
| } | |
| async with aiohttp.ClientSession() as session: | |
| async with session.post(f"{BASE_URL}/intelligent/search", json=payload, headers=headers) as resp: | |
| return await resp.json() | |