### CLI Usage Examples Source: https://github.com/koromodako/aionyphe/blob/master/README.md Demonstrates various command-line operations for the aionyphe CLI, including getting help, exporting data, checking IP, and searching with pagination. ```bash aionyphe -h ``` ```bash aionyphe export -h ``` ```bash aionyphe export 'category:datascan domain:google.com' ``` ```bash aionyphe myip ``` ```bash aionyphe user | jq ``` ```bash aionyphe search --first 2 --last 4 'category:datascan domain:google.com' ``` -------------------------------- ### Aionyphe CLI Examples Source: https://context7.com/koromodako/aionyphe/llms.txt The `aionyphe` CLI provides a pipe-friendly interface for Onyphe data, composable with tools like `jq`. Examples cover IP lookup, data export, search with pagination, and alert management. ```bash # Show current public IP aionyphe myip ``` ```bash # Show account info and credits aionyphe user | jq ``` ```bash # Export all datascan results for a domain (Eagle View required) aionyphe export 'category:datascan domain:example.com' > results.ndjson ``` ```bash # Search with pagination (pages 1 to 5) aionyphe search --first 1 --last 5 'category:datascan product:Nginx' | jq .ip ``` ```bash # Summary for an IP (all categories, 10 latest per category) aionyphe summary ip 8.8.8.8 ``` ```bash # Best geoloc match for an IP aionyphe simple-best geoloc 8.8.8.8 ``` ```bash # Bulk summary from file aionyphe bulk-summary ip /path/to/ip-list.txt | jq .country ``` ```bash # Bulk discovery assets aionyphe bulk-discovery-asset datascan /path/to/assets.txt ``` ```bash # Manage alerts aionyphe alert-list ``` ```bash aionyphe alert-add "my-alert" alerts@example.com 'category:datascan product:Apache' ``` ```bash aionyphe alert-del "alert-id-123" ``` ```bash # Use a proxy via CLI flags aionyphe --proxy-scheme http --proxy-host squid.corp.example.com --proxy-port 3128 \ search 'category:vulnscan severity:critical' ``` -------------------------------- ### Install Aionyphe SDK Source: https://context7.com/koromodako/aionyphe/llms.txt Install the Aionyphe SDK from GitHub using pip. Optional uvloop can be installed for performance improvements on Linux/macOS. ```bash python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install git+https://github.com/koromodako/aionyphe pip install uvloop # Linux/macOS only ``` -------------------------------- ### Install aionyphe with uvloop Source: https://github.com/koromodako/aionyphe/blob/master/README.md Install the aionyphe library from GitHub and uvloop for enhanced performance on Linux/Darwin. ```bash python -m venv venv source venv/bin/activate pip install git+https://github.com/koromodako/aionyphe pip install uvloop ``` -------------------------------- ### CLI - Proxy Configuration Source: https://context7.com/koromodako/aionyphe/llms.txt Example of using command-line flags to configure proxy settings for the `aionyphe` CLI. ```APIDOC ### Proxy Configuration via CLI Flags ```bash # Use a proxy via CLI flags aionyphe --proxy-scheme http --proxy-host squid.corp.example.com --proxy-port 3128 \ search 'category:vulnscan severity:critical' ``` ``` -------------------------------- ### Direct API Connection Example Source: https://github.com/koromodako/aionyphe/blob/master/README.md Connect directly to the Onyphe API using your API key and perform an export query. Requires the 'aionyphe' library. ```python from json import dumps from asyncio import run from getpass import getpass from aionyphe import OnypheAPIClient, client_session async def main(): oql = 'category:datascan domain:google.com' api_key = getpass("Enter Onyphe API key: ") async with client_session(api_key) as client: api_client = OnypheAPIClient(client=client) async for _, result in api_client.export(oql): print(dumps(result)) if __name__ == '__main__': run(main()) ``` -------------------------------- ### Proxy API Connection Example Source: https://github.com/koromodako/aionyphe/blob/master/README.md Connect to the Onyphe API through a specified HTTP proxy. Configure the proxy host and port. Requires the 'aionyphe' library. ```python from json import dumps from asyncio import run from getpass import getpass from aionyphe import OnypheAPIClient, OnypheAPIClientProxy, client_session async def main(): oql = 'category:datascan domain:google.com' api_key = getpass("Enter Onyphe API key: ") proxy = OnypheAPIClientProxy( scheme='http', host='squid.domain.tld', port=3128 ) async with client_session(api_key) as client: api_client = OnypheAPIClient(client=client, proxy=proxy) async for _, result in api_client.export(oql): print(dumps(result)) if __name__ == '__main__': run(main()) ``` -------------------------------- ### Get Summarized Data for IP, Domain, or Hostname Source: https://context7.com/koromodako/aionyphe/llms.txt Returns the 10 latest results across all data categories for a given IP, domain, or hostname. Supports pagination and summary types 'ip', 'domain', and 'hostname'. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session from aionyphe.enum import OnypheSummaryType async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) async for meta, result in api_client.summary( OnypheSummaryType.IP, "8.8.8.8", page=1 ): print(dumps(result)) # Output: {"category": "geoloc", "ip": "8.8.8.8", "country": "US", ...} run(main()) ``` -------------------------------- ### OnypheAPIClient.summary Source: https://context7.com/koromodako/aionyphe/llms.txt Get summarized data for an IP, domain, or hostname. Returns the 10 latest results across all data categories for the given needle. Supports pagination and summary types `ip`, `domain`, and `hostname`. ```APIDOC ## `OnypheAPIClient.summary` — Get summarized data for an IP, domain, or hostname Returns the 10 latest results across all data categories for the given needle. Supports pagination and summary types `ip`, `domain`, and `hostname`. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session from aionyphe.enum import OnypheSummaryType async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) async for meta, result in api_client.summary( OnypheSummaryType.IP, "8.8.8.8", page=1 ): print(dumps(result)) # Output: {"category": "geoloc", "ip": "8.8.8.8", "country": "US", ...} run(main()) ``` ``` -------------------------------- ### Get Best-Matching Subnet for an IP Source: https://context7.com/koromodako/aionyphe/llms.txt Returns a single result with the tightest matching CIDR subnet for a given IP across supported 'best' categories: 'whois', 'geoloc', 'inetnum', 'threatlist'. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session from aionyphe.enum import OnypheCategory async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) async for meta, result in api_client.simple_best( OnypheCategory.GEOLOC, "8.8.8.8" ): print(dumps(result)) # Output: {"subnet": "8.8.8.0/24", "country": "US", "city": "Mountain View", ...} run(main()) ``` -------------------------------- ### Bulk OQL Discovery via Asset File Source: https://context7.com/koromodako/aionyphe/llms.txt Submits a file of asset identifiers and runs bulk discovery queries against a given category. Auto-scrolls through all results and streams NDJSON output. ```python from asyncio import run from json import dumps from pathlib import Path from aionyphe import OnypheAPIClient, client_session from aionyphe.enum import OnypheCategory async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) async for _, result in api_client.bulk_discovery_asset( OnypheCategory.DATASCAN, filepath=Path("assets.txt"), ): print(dumps(result)) run(main()) ``` -------------------------------- ### Search Data with OQL Source: https://context7.com/koromodako/aionyphe/llms.txt Searches Onyphe data using OQL. Returns up to 10 results per page for the last 30 days. The 'meta' dict includes pagination info. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) oql = "category:datascan product:Nginx protocol:http os:Windows tls:true" async for meta, result in api_client.search(oql, page=1): # meta: {"count": 10, "max_page": 42, "total": 418, ...} # result: {"ip": "203.0.113.5", "port": "443", "product": "Nginx", ...} print(dumps(result)) run(main()) ``` -------------------------------- ### Manage Onyphe Alerts with Python SDK Source: https://context7.com/koromodako/aionyphe/llms.txt Use the OnypheAPIClient to list, add, or delete OQL-based alerts with email notifications. Ensure you have your API key configured. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) # List all alerts async for _, result in api_client.alert_list(): print("Alert:", dumps(result)) # Add a new alert async for _, result in api_client.alert_add( name="nginx-windows-tls", oql="category:datascan product:Nginx os:Windows tls:true", email="alerts@example.com", ): print("Add result:", dumps(result)) # Delete alert by ID async for _, result in api_client.alert_del("alert-id-123"): print("Del result:", dumps(result)) run(main()) ``` -------------------------------- ### CLI - Search and Summary Source: https://context7.com/koromodako/aionyphe/llms.txt Command-line interface commands for searching data and retrieving summaries, including options for pagination and IP-based lookups. ```APIDOC ### Search and Summary Commands ```bash # Search with pagination (pages 1 to 5) aionyphe search --first 1 --last 5 'category:datascan product:Nginx' | jq .ip # Summary for an IP (all categories, 10 latest per category) aionyphe summary ip 8.8.8.8 # Best geoloc match for an IP aionyphe simple-best geoloc 8.8.8.8 ``` ``` -------------------------------- ### client_session — Create an authenticated HTTP session Source: https://context7.com/koromodako/aionyphe/llms.txt Creates the underlying aiohttp.ClientSession pre-configured with the Onyphe API key, base URL, and optional timeouts. Must be used as an async context manager to ensure proper connection cleanup. ```APIDOC ## client_session ### Description Creates the underlying `aiohttp.ClientSession` pre-configured with the Onyphe API key, base URL, and optional timeouts. Must be used as an async context manager to ensure proper connection cleanup. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from asyncio import run from aionyphe import client_session, OnypheAPIClient async def main(): async with client_session( api_key="YOUR_API_KEY", scheme="https", host="www.onyphe.io", port=443, total=60, # total request timeout in seconds connect=10, # connection acquisition timeout sock_read=30, # socket read timeout sock_connect=10, # socket connect timeout ) as client: api_client = OnypheAPIClient(client=client) # use api_client ... run(main()) ``` ### Response #### Success Response (200) This function returns an `aiohttp.ClientSession` object. #### Response Example None ``` -------------------------------- ### CLI - Basic Commands Source: https://context7.com/koromodako/aionyphe/llms.txt Common command-line interface commands for interacting with the Onyphe API, including fetching IP information, user data, and exporting results. ```APIDOC ## CLI — Command-line interface (`aionyphe`) The `aionyphe` CLI exposes all SDK features with a JSON-per-line pipe-friendly interface, composable with tools like `jq`. ### Basic Usage Examples ```bash # Show current public IP aionyphe myip # Show account info and credits aionyphe user | jq # Export all datascan results for a domain (Eagle View required) aionyphe export 'category:datascan domain:example.com' > results.ndjson ``` ``` -------------------------------- ### Aionyphe Configuration File Source: https://context7.com/koromodako/aionyphe/llms.txt Store persistent settings like API key, proxy details, and timeouts in a JSON file at `~/.aionyphe`. Command-line arguments will override these settings. ```json { "api_key": "YOUR_API_KEY", "scheme": "https", "host": "www.onyphe.io", "port": 443, "version": "v2", "proxy_scheme": "http", "proxy_host": "squid.corp.example.com", "proxy_port": 3128, "proxy_username": "proxyuser", "proxy_password": "proxypass", "total": 60, "connect": 10, "sock_read": 30, "sock_connect": 10 } ``` -------------------------------- ### CLI - Bulk Operations and Alert Management Source: https://context7.com/koromodako/aionyphe/llms.txt Command-line interface commands for performing bulk operations like summary and discovery, and for managing alerts. ```APIDOC ### Bulk Operations and Alert Management Commands ```bash # Bulk summary from file aionyphe bulk-summary ip /path/to/ip-list.txt | jq .country # Bulk discovery assets aionyphe bulk-discovery-asset datascan /path/to/assets.txt # Manage alerts aionyphe alert-list aionyphe alert-add "my-alert" alerts@example.com 'category:datascan product:Apache' aionyphe alert-del "alert-id-123" ``` ``` -------------------------------- ### OnypheAPIClient.bulk_discovery_asset Source: https://context7.com/koromodako/aionyphe/llms.txt Bulk OQL discovery via asset file. Submits a file of asset identifiers and runs bulk discovery queries against a given category. Auto-scrolls through all results and streams NDJSON output. ```APIDOC ## `OnypheAPIClient.bulk_discovery_asset` — Bulk OQL discovery via asset file Submits a file of asset identifiers and runs bulk discovery queries against a given category. Auto-scrolls through all results and streams NDJSON output. ```python from asyncio import run from json import dumps from pathlib import Path from aionyphe import OnypheAPIClient, client_session from aionyphe.enum import OnypheCategory async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) async for _, result in api_client.bulk_discovery_asset( OnypheCategory.DATASCAN, filepath=Path("assets.txt"), ): print(dumps(result)) run(main()) ``` ``` -------------------------------- ### OnypheAPIClient.search Source: https://context7.com/koromodako/aionyphe/llms.txt Searches all Onyphe data using OQL. Returns up to 10 results per page covering the last 30 days. The `meta` dict includes pagination info (`max_page`, `total`, etc.). ```APIDOC ## `OnypheAPIClient.search` — Search using ONYPHE Query Language (OQL) Searches all Onyphe data using OQL. Returns up to 10 results per page covering the last 30 days. The `meta` dict includes pagination info (`max_page`, `total`, etc.). ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) oql = "category:datascan product:Nginx protocol:http os:Windows tls:true" async for meta, result in api_client.search(oql, page=1): # meta: {"count": 10, "max_page": 42, "total": 418, ...} # result: {"ip": "203.0.113.5", "port": "443", "product": "Nginx", ...} print(dumps(result)) run(main()) ``` ``` -------------------------------- ### OnypheAPIClient.bulk_summary Source: https://context7.com/koromodako/aionyphe/llms.txt Batch IP/domain summary lookups. Accepts a newline-separated file (or raw bytes) of IPs or domains and returns NDJSON summary results for each. Efficiently processes large lists in a single request. ```APIDOC ## `OnypheAPIClient.bulk_summary` — Batch IP/domain summary lookups Accepts a newline-separated file (or raw bytes) of IPs or domains and returns NDJSON summary results for each. Efficiently processes large lists in a single request. ```python from asyncio import run from json import dumps from pathlib import Path from aionyphe import OnypheAPIClient, client_session from aionyphe.enum import OnypheSummaryType # ip-list.txt contents: # 8.8.8.8 # 1.1.1.1 # 93.184.216.34 async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) async for _, result in api_client.bulk_summary( OnypheSummaryType.IP, filepath=Path("ip-list.txt"), ): print(dumps(result)) # One JSON object per line per IP # Or pass raw bytes directly: raw = b"8.8.8.8\n1.1.1.1\n" async for _, result in api_client.bulk_summary(OnypheSummaryType.IP, data=raw): print(dumps(result)) run(main()) ``` ``` -------------------------------- ### Create Authenticated HTTP Session Source: https://context7.com/koromodako/aionyphe/llms.txt Creates an authenticated `aiohttp.ClientSession` for the Onyphe API. Use as an async context manager for proper connection cleanup. Configure timeouts for total requests, connection acquisition, and socket operations. ```python from asyncio import run from aionyphe import client_session, OnypheAPIClient async def main(): async with client_session( api_key="YOUR_API_KEY", scheme="https", host="www.onyphe.io", port=443, total=60, # total request timeout in seconds connect=10, # connection acquisition timeout sock_read=30, # socket read timeout sock_connect=10, # socket connect timeout ) as client: api_client = OnypheAPIClient(client=client) # use api_client ... run(main()) ``` -------------------------------- ### Configure HTTP Proxy Source: https://context7.com/koromodako/aionyphe/llms.txt Configure Aionyphe to route requests through an HTTP proxy. Pass an `OnypheAPIClientProxy` instance to `OnypheAPIClient`. Proxy authentication is optional. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, OnypheAPIClientProxy, client_session async def main(): proxy = OnypheAPIClientProxy( scheme="http", host="squid.corp.example.com", port=3128, username="proxyuser", # optional password="proxypass", # optional ) async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client, proxy=proxy) async for _, result in api_client.user(): print(dumps(result)) ``` -------------------------------- ### Batch IP/Domain Summary Lookups Source: https://context7.com/koromodako/aionyphe/llms.txt Accepts a newline-separated file or raw bytes of IPs or domains and returns NDJSON summary results for each. Efficiently processes large lists in a single request. ```python from asyncio import run from json import dumps from pathlib import Path from aionyphe import OnypheAPIClient, client_session from aionyphe.enum import OnypheSummaryType # ip-list.txt contents: # 8.8.8.8 # 1.1.1.1 # 93.184.216.34 async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) async for _, result in api_client.bulk_summary( OnypheSummaryType.IP, filepath=Path("ip-list.txt"), ): print(dumps(result)) # One JSON object per line per IP # Or pass raw bytes directly: raw = b"8.8.8.8\n1.1.1.1\n" async for _, result in api_client.bulk_summary(OnypheSummaryType.IP, data=raw): print(dumps(result)) run(main()) ``` -------------------------------- ### OnypheAPIClient.user — Retrieve user account information Source: https://context7.com/koromodako/aionyphe/llms.txt Returns API access permissions, allowed filter list, and remaining API credits for the authenticated account. ```APIDOC ## OnypheAPIClient.user ### Description Returns API access permissions, allowed filter list, and remaining API credits for the authenticated account. ### Method GET (implied by client interaction) ### Endpoint `/user` (implied by client interaction) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) async for meta, result in api_client.user(): print(dumps(result)) # Output: {"plan": "eagle", "credits": 9800, "myip": "1.2.3.4", ...} run(main()) ``` ### Response #### Success Response (200) - **meta** (dict) - Metadata about the request. - **result** (dict) - User account information including plan, credits, and IP address. #### Response Example ```json { "plan": "eagle", "credits": 9800, "myip": "1.2.3.4" } ``` ``` -------------------------------- ### OnypheAPIClient.simple_best Source: https://context7.com/koromodako/aionyphe/llms.txt Best-matching subnet for an IP. Returns a single result with the tightest matching CIDR subnet for the given IP across supported "best" categories: `whois`, `geoloc`, `inetnum`, `threatlist`. ```APIDOC ## `OnypheAPIClient.simple_best` — Best-matching subnet for an IP Returns a single result with the tightest matching CIDR subnet for the given IP across supported "best" categories: `whois`, `geoloc`, `inetnum`, `threatlist`. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session from aionyphe.enum import OnypheCategory async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) async for meta, result in api_client.simple_best( OnypheCategory.GEOLOC, "8.8.8.8" ): print(dumps(result)) # Output: {"subnet": "8.8.8.0/24", "country": "US", "city": "Mountain View", ...} run(main()) ``` ``` -------------------------------- ### Retrieve User Account Information Source: https://context7.com/koromodako/aionyphe/llms.txt Retrieves API access permissions, allowed filter list, and remaining API credits for the authenticated account. The result includes plan details, credit balance, and the user's IP address. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) async for meta, result in api_client.user(): print(dumps(result)) # Output: {"plan": "eagle", "credits": 9800, "myip": "1.2.3.4", ...} ``` -------------------------------- ### OnypheAPIClientProxy — Configure HTTP proxy Source: https://context7.com/koromodako/aionyphe/llms.txt Dataclass holding proxy connection parameters. Pass an instance to OnypheAPIClient to route all requests through the proxy. ```APIDOC ## OnypheAPIClientProxy ### Description Dataclass holding proxy connection parameters. Pass an instance to `OnypheAPIClient` to route all requests through the proxy. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, OnypheAPIClientProxy, client_session async def main(): proxy = OnypheAPIClientProxy( scheme="http", host="squid.corp.example.com", port=3128, username="proxyuser", # optional password="proxypass", # optional ) async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client, proxy=proxy) async for _, result in api_client.user(): print(dumps(result)) run(main()) ``` ### Response #### Success Response (200) This configuration does not directly return a response, but enables proxying for subsequent API calls. #### Response Example None ``` -------------------------------- ### Export All Matching Results via OQL Source: https://context7.com/koromodako/aionyphe/llms.txt Exports the complete result set for an OQL query as streaming NDJSON. Requires an Eagle View subscription and is limited to one concurrent request. Automatically scrolls through all results. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) oql = "category:datascan domain:example.com" async for _, result in api_client.export(oql): print(dumps(result)) # Each line: {"ip": "93.184.216.34", "domain": "example.com", ...} run(main()) ``` -------------------------------- ### OnypheAPIClient.export Source: https://context7.com/koromodako/aionyphe/llms.txt Exports the complete result set for an OQL query as streaming NDJSON. Requires an Eagle View subscription. Limited to one concurrent request (enforced by default semaphore). Scrolls through all results automatically. ```APIDOC ## `OnypheAPIClient.export` — Export all matching results via OQL Exports the complete result set for an OQL query as streaming NDJSON. Requires an Eagle View subscription. Limited to one concurrent request (enforced by default semaphore). Scrolls through all results automatically. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) oql = "category:datascan domain:example.com" async for _, result in api_client.export(oql): print(dumps(result)) # Each line: {"ip": "93.184.216.34", "domain": "example.com", ...} run(main()) ``` ``` -------------------------------- ### Iterate Over Search Result Pages Source: https://github.com/koromodako/aionyphe/blob/master/README.md A helper function to easily iterate over multiple pages of search results. Specify the search function, arguments, and page range. Requires the 'aionyphe' library. ```python from json import dumps from asyncio import run from getpass import getpass from aionyphe import OnypheAPIClient, client_session, iter_pages async def main(): oql = 'category:datascan domain:google.com' api_key = getpass("Enter Onyphe API key: ") async with client_session(api_key) as client: api_client = OnypheAPIClient(client=client) async for _, result in iter_pages(api_client.search, [oql], 2, 4): print(dumps(result)) if __name__ == '__main__': run(main()) ``` -------------------------------- ### OnypheAPIClientRateLimiting — Configure concurrency limits Source: https://context7.com/koromodako/aionyphe/llms.txt Controls per-feature semaphore-based rate limiting. By default, `export` is limited to 1 concurrent request; all other features are unlimited. Disable entirely or override per feature. ```APIDOC ## OnypheAPIClientRateLimiting ### Description Controls per-feature semaphore-based rate limiting. By default, `export` is limited to 1 concurrent request; all other features are unlimited. Disable entirely or override per feature. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, OnypheAPIClientRateLimiting from aionyphe.enum import OnypheFeature async def main(): rate_limiting = OnypheAPIClientRateLimiting( enabled=True, rate_limits={ OnypheFeature.SEARCH: 5, # max 5 concurrent search requests OnypheFeature.EXPORT: 1, # keep export at 1 (default) }, ) async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client, rate_limiting=rate_limiting) async for _, result in api_client.search("category:datascan product:Nginx"): print(dumps(result)) run(main()) ``` ### Response #### Success Response (200) This configuration does not directly return a response, but modifies the rate limiting behavior for subsequent API calls. #### Response Example None ``` -------------------------------- ### OnypheAPIClient Alert Management Source: https://context7.com/koromodako/aionyphe/llms.txt Manage Onyphe alerts: list all configured alerts, add new OQL-based alerts with email notifications, or delete alerts by their identifier. ```APIDOC ## `OnypheAPIClient.alert_list` / `alert_add` / `alert_del` — Manage Onyphe alerts List all configured OQL-based alerts, create new ones with email notifications, or delete them by identifier. ### Usage ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) # List all alerts async for _, result in api_client.alert_list(): print("Alert:", dumps(result)) # Add a new alert async for _, result in api_client.alert_add( name="nginx-windows-tls", oql="category:datascan product:Nginx os:Windows tls:true", email="alerts@example.com", ): print("Add result:", dumps(result)) # Delete alert by ID async for _, result in api_client.alert_del("alert-id-123"): print("Del result:", dumps(result)) run(main()) ``` ``` -------------------------------- ### Configure Concurrency Limits Source: https://context7.com/koromodako/aionyphe/llms.txt Configure per-feature semaphore-based rate limiting. By default, `export` is limited to 1 concurrent request. Disable entirely or override limits per feature using `OnypheFeature` enum. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, OnypheAPIClientRateLimiting from aionyphe.enum import OnypheFeature async def main(): rate_limiting = OnypheAPIClientRateLimiting( enabled=True, rate_limits={ OnypheFeature.SEARCH: 5, # max 5 concurrent search requests OnypheFeature.EXPORT: 1, # keep export at 1 (default) }, ) async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client, rate_limiting=rate_limiting) async for _, result in api_client.search("category:datascan product:Nginx"): print(dumps(result)) ``` -------------------------------- ### Iterate Through Paginated Results with `iter_pages` Source: https://context7.com/koromodako/aionyphe/llms.txt The `iter_pages` helper coroutine simplifies fetching data across multiple pages from a paginated API method. It automatically respects the `max_page` limit from the API response. ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session, iter_pages async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) oql = "category:datascan domain:google.com" # Fetch pages 2 through 4 (capped at actual max_page) async for meta, result in iter_pages(api_client.search, [oql], first=2, last=4): print(f"Page context: max={meta.get('max_page')}") print(dumps(result)) run(main()) ``` -------------------------------- ### iter_pages Helper Coroutine Source: https://context7.com/koromodako/aionyphe/llms.txt A helper coroutine that simplifies iterating through multiple pages of results from a paginated API method, automatically handling page capping. ```APIDOC ## `iter_pages` — Iterate through multiple pages of results Helper coroutine that transparently pages through a paginated API method from `first` to `last` page, automatically capping at `max_page` from the API response metadata. ### Usage ```python from asyncio import run from json import dumps from aionyphe import OnypheAPIClient, client_session, iter_pages async def main(): async with client_session("YOUR_API_KEY") as client: api_client = OnypheAPIClient(client=client) oql = "category:datascan domain:google.com" # Fetch pages 2 through 4 (capped at actual max_page) async for meta, result in iter_pages(api_client.search, [oql], first=2, last=4): print(f"Page context: max={meta.get('max_page')}") print(dumps(result)) run(main()) ``` ``` -------------------------------- ### Search Specific Result Page Source: https://github.com/koromodako/aionyphe/blob/master/README.md Retrieve a specific page of search results from the Onyphe API. Use the 'page' parameter to specify the desired page number. Requires the 'aionyphe' library. ```python from json import dumps from asyncio import run from getpass import getpass from aionyphe import OnypheAPIClient, client_session async def main(): oql = 'category:datascan domain:google.com' api_key = getpass("Enter Onyphe API key: ") async with client_session(api_key) as client: api_client = OnypheAPIClient(client=client) async for _, result in api_client.search(oql, page=2): print(dumps(result)) if __name__ == '__main__': run(main()) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.