Spaces:
No application file
No application file
Download src/connectors/intelligencex.py from abello/OSINT: direct link, hf CLI and curl.
- Browser
- Download file 533 Bytes
-
https://huggingface.co/spaces/abello/OSINT/resolve/main/src/connectors/intelligencex.py
- Command line
-
hf download hf://spaces/abello/OSINT/src/connectors/intelligencex.py
-
curl -L -o intelligencex.py https://huggingface.co/spaces/abello/OSINT/resolve/main/src/connectors/intelligencex.py
533 Bytes
| 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() | |