### Get Action Map - Bash Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Retrieves the complete mapping of entity types to available OSINT tools. This endpoint returns a JSON structure defining which investigation tools can be run against each supported entity type. ```bash # Fetch the action map to discover available OSINT tools curl -X GET http://localhost:8000/action-map # Expected response: { "success": true, "message": { "Email": [ {"tool": "sherlock", "label": "Find connected accounts", "queryField": "address"}, {"tool": "emailrep", "label": "Check email reputation", "queryField": "address"}, {"tool": "holehe", "label": "Check email registration (Holehe)", "queryField": "address"}, {"tool": "Have I Been Pwned", "label": "Check for breaches", "queryField": "address"} ], "Phone Number": [ {"tool": "phoneinfoga", "label": "Scan phone number", "queryField": "number"} ], "Domain": [ {"tool": "theharvester", "label": "Harvest domain data", "queryField": "domain"}, {"tool": "amass_enum", "label": "Subdomain enumeration", "queryField": "domain"}, {"tool": "amass_intel", "label": "Gather domain intelligence", "queryField": "domain"}, {"tool": "dnstwist", "label": "Detect typosquatting", "queryField": "domain"} ], "IP Address": [ {"tool": "shodan", "label": "Scan host with Shodan", "queryField": "ip"}, {"tool": "nmap", "label": "Run Nmap scan", "queryField": "ip"}, {"tool": "masscan", "label": "Run Masscan", "queryField": "ip"} ], "File": [ {"tool": "exiftool", "label": "Extract metadata (ExifTool)", "queryField": "File Name"} ], "Username": [ {"tool": "sherlock", "label": "Find connected accounts", "queryField": "username"} ] }, "data": null } ``` -------------------------------- ### Get All Task Results (Bash) Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Retrieves all historical OSINT investigation task results from the SQLite database. Results are ordered by timestamp in descending order. This endpoint returns the complete history of executed scans, including the source tool, query, parsed results, and execution timestamp. ```bash # Fetch all historical task results curl -X GET http://localhost:8000/task-results # Expected response: { "success": true, "message": "Success", "data": [ { "id": 1, "source": "sherlock", "query": "johndoe", "result": {"platforms_found": 15, "accounts": [...]}, "timestamp": "2024-01-15T10:30:00Z" }, { "id": 2, "source": "shodan", "query": "8.8.8.8", "result": {"ports": [53, 443], "organization": "Google LLC"}, "timestamp": "2024-01-15T09:15:00Z" } ] } ``` -------------------------------- ### Get All Task Results Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Retrieves all stored OSINT investigation results from the SQLite database, ordered by timestamp in descending order. This endpoint returns the complete history of executed scans. ```APIDOC ## GET /task-results ### Description Retrieves all stored OSINT investigation results from the SQLite database, ordered by timestamp in descending order (most recent first). Returns the complete history of executed scans including source tool, query, parsed results, and execution timestamp. ### Method GET ### Endpoint /task-results ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the outcome of the request. - **data** (array) - An array of task result objects. - **id** (integer) - Unique identifier for the task result. - **source** (string) - The OSINT tool or source used for the query. - **query** (string) - The query string used for the investigation. - **result** (object) - The parsed results from the OSINT tool. - **timestamp** (string) - The ISO 8601 timestamp when the task was executed. #### Response Example ```json { "success": true, "message": "Success", "data": [ { "id": 1, "source": "sherlock", "query": "johndoe", "result": {"platforms_found": 15, "accounts": [...]}, "timestamp": "2024-01-15T10:30:00Z" }, { "id": 2, "source": "shodan", "query": "8.8.8.8", "result": {"ports": [53, 443], "organization": "Google LLC"}, "timestamp": "2024-01-15T09:15:00Z" } ] } ``` ``` -------------------------------- ### Get Action Map Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Retrieves the complete mapping of entity types to available OSINT tools. This endpoint returns a JSON structure defining which investigation tools can be run against each supported entity type. ```APIDOC ## GET /action-map ### Description Retrieves the complete mapping of entity types to available OSINT tools. This endpoint returns a JSON structure defining which investigation tools can be run against each supported entity type (Email, Phone Number, Domain, IP Address, File, Username), including the tool identifier, display label, and required query field. ### Method GET ### Endpoint /action-map ### Parameters #### Query Parameters None ### Request Example ```bash curl -X GET http://localhost:8000/action-map ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (object) - A message describing the outcome of the request. - **data** (null) - Placeholder for potential future data, currently null. #### Response Example ```json { "success": true, "message": { "Email": [ {"tool": "sherlock", "label": "Find connected accounts", "queryField": "address"}, {"tool": "emailrep", "label": "Check email reputation", "queryField": "address"}, {"tool": "holehe", "label": "Check email registration (Holehe)", "queryField": "address"}, {"tool": "Have I Been Pwned", "label": "Check for breaches", "queryField": "address"} ], "Phone Number": [ {"tool": "phoneinfoga", "label": "Scan phone number", "queryField": "number"} ], "Domain": [ {"tool": "theharvester", "label": "Harvest domain data", "queryField": "domain"}, {"tool": "amass_enum", "label": "Subdomain enumeration", "queryField": "domain"}, {"tool": "amass_intel", "label": "Gather domain intelligence", "queryField": "domain"}, {"tool": "dnstwist", "label": "Detect typosquatting", "queryField": "domain"} ], "IP Address": [ {"tool": "shodan", "label": "Scan host with Shodan", "queryField": "ip"}, {"tool": "nmap", "label": "Run Nmap scan", "queryField": "ip"}, {"tool": "masscan", "label": "Run Masscan", "queryField": "ip"} ], "File": [ {"tool": "exiftool", "label": "Extract metadata (ExifTool)", "queryField": "File Name"} ], "Username": [ {"tool": "sherlock", "label": "Find connected accounts", "queryField": "username"} ] }, "data": null } ``` ``` -------------------------------- ### Get Task Result Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Polls for the result of a specific background task using its task ID. Returns the task status (pending or SUCCESS) and the result data when the task has completed. ```APIDOC ## GET /task-result/{task_id} ### Description Polls for the result of a specific background task using its task ID. Returns the task status (pending or SUCCESS) and the result data when the task has completed. Use this endpoint when not using WebSocket connections for real-time updates. ### Method GET ### Endpoint /task-result/{task_id} ### Parameters #### Path Parameters - **task_id** (string) - Required - The unique identifier of the task to retrieve results for. #### Query Parameters None ### Request Example ```bash # Check status of a running task curl -X GET http://localhost:8000/task-result/a1b2c3d4-e5f6-7890-abcd-ef1234567890 ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the outcome. - **data** (object) - Contains the task status and results if available. - **status** (string) - The current status of the task (e.g., "pending", "SUCCESS"). - **result** (object) - The results of the OSINT tool execution, present only if status is "SUCCESS". #### Response Example (Task Pending) ```json { "success": true, "message": "Success", "data": { "status": "pending" } } ``` #### Response Example (Task Completed) ```json { "success": true, "message": "Success", "data": { "status": "SUCCESS", "result": { "tool": "sherlock", "query": "johndoe", "findings": [ {"platform": "GitHub", "url": "https://github.com/johndoe", "exists": true}, {"platform": "Twitter", "url": "https://twitter.com/johndoe", "exists": true} ] } } } ``` ``` -------------------------------- ### Get Task Result - Bash Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Polls for the result of a specific background task using its task ID. Returns the task status (pending or SUCCESS) and the result data when the task has completed. This is an alternative to WebSocket for real-time updates. ```bash # Check status of a running task curl -X GET http://localhost:8000/task-result/a1b2c3d4-e5f6-7890-abcd-ef1234567890 # Response when task is still running: { "success": true, "message": "Success", "data": { "status": "pending" } } # Response when task completes: { "success": true, "message": "Success", "data": { "status": "SUCCESS", "result": { "tool": "sherlock", "query": "johndoe", "findings": [ {"platform": "GitHub", "url": "https://github.com/johndoe", "exists": true}, {"platform": "Twitter", "url": "https://twitter.com/johndoe", "exists": true} ] } } } ``` -------------------------------- ### Upload File for Analysis (Bash) Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Uploads a file to the server for analysis by file-based OSINT tools, such as ExifTool. Uploaded files are stored in the 'file_uploads' directory and can be referenced in subsequent tool execution requests. This enables metadata extraction and analysis of file content. ```bash # Upload a file for metadata extraction curl -X POST http://localhost:8000/upload-file \ -F "file=@/path/to/image.jpg" # Expected response: { "success": true, "message": "File uploaded successfully", "data": { "filename": "image.jpg" } } # Then run ExifTool on the uploaded file curl -X POST http://localhost:8000/run/exiftool \ -H "Content-Type: application/json" \ -d '{"query": "image.jpg", "node_id": "node-file-001"}' ``` -------------------------------- ### Run ExifTool Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Runs the ExifTool on an uploaded file to extract metadata. This endpoint is typically called after a file has been uploaded. ```APIDOC ## POST /run/exiftool ### Description Runs the ExifTool on an uploaded file to extract metadata. This endpoint is typically called after a file has been uploaded using the `/upload-file` endpoint. ### Method POST ### Endpoint /run/exiftool ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **query** (string) - Required - The filename of the uploaded file to analyze. - **node_id** (string) - Required - An identifier for the analysis node. ### Request Example ```bash curl -X POST http://localhost:8000/run/exiftool \ -H "Content-Type: application/json" \ -d '{"query": "image.jpg", "node_id": "node-file-001"}' ``` ### Response #### Success Response (200) *Note: The exact response structure for tool execution might vary. This is a general example.* - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the outcome of the request. - **data** (object) - The results of the ExifTool analysis. #### Response Example ```json { "success": true, "message": "ExifTool analysis completed", "data": { "SourceFile": "image.jpg", "ExifToolVersion": 12.40, "FileSize": "1.2 MB", "MIMEType": "image/jpeg", "ImageWidth": 1920, "ImageHeight": 1080, "CreateDate": "2023-10-27T10:00:00-07:00" } } ``` ``` -------------------------------- ### Run OSINT Task Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Queues an OSINT tool execution as a background Celery task. The endpoint accepts a source tool name as a path parameter and a JSON body containing the query value and node identifier for result correlation. ```APIDOC ## POST /run/{tool_name} ### Description Queues an OSINT tool execution as a background Celery task. The endpoint accepts a source tool name as a path parameter and a JSON body containing the query value and node identifier for result correlation. Returns a task ID that can be used to poll for results or receive updates via WebSocket. ### Method POST ### Endpoint /run/{tool_name} ### Parameters #### Path Parameters - **tool_name** (string) - Required - The name of the OSINT tool to run (e.g., "sherlock", "emailrep", "shodan"). #### Query Parameters None #### Request Body - **query** (string) - Required - The value to be queried by the OSINT tool (e.g., username, email, IP address). - **node_id** (string) - Required - An identifier for correlating results, useful in larger investigations. ### Request Example ```bash # Run a Sherlock scan to find accounts associated with a username curl -X POST http://localhost:8000/run/sherlock \ -H "Content-Type: application/json" \ -d '{"query": "johndoe", "node_id": "node-123"}' # Run an email reputation check curl -X POST http://localhost:8000/run/emailrep \ -H "Content-Type: application/json" \ -d '{"query": "user@example.com", "node_id": "node-456"}' # Run a Shodan scan on an IP address curl -X POST http://localhost:8000/run/shodan \ -H "Content-Type: application/json" \ -d '{"query": "8.8.8.8", "node_id": "node-789"}' ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message confirming the task was queued. - **data** (object) - Contains the task ID for the queued operation. - **task_id** (string) - The unique identifier for the background task. #### Response Example ```json { "success": true, "message": "Success", "data": { "task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } } ``` ``` -------------------------------- ### Upload File Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Uploads a file for analysis by file-based OSINT tools. Files are stored in the `file_uploads` directory and can be referenced in subsequent tool executions. ```APIDOC ## POST /upload-file ### Description Uploads a file for analysis by file-based OSINT tools like ExifTool. Files are stored in the `file_uploads` directory and can be referenced in subsequent tool executions for metadata extraction and analysis. ### Method POST ### Endpoint /upload-file ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **file** (file) - Required - The file to upload for analysis. ### Request Example ```bash curl -X POST http://localhost:8000/upload-file \ -F "file=@/path/to/image.jpg" ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the outcome of the request. - **data** (object) - An object containing information about the uploaded file. - **filename** (string) - The name of the uploaded file. #### Response Example ```json { "success": true, "message": "File uploaded successfully", "data": { "filename": "image.jpg" } } ``` ``` -------------------------------- ### Run OSINT Task - Bash Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Queues an OSINT tool execution as a background Celery task. The endpoint accepts a source tool name and a JSON body containing the query value and node identifier. Returns a task ID for polling or WebSocket updates. ```bash # Run a Sherlock scan to find accounts associated with a username curl -X POST http://localhost:8000/run/sherlock \ -H "Content-Type: application/json" \ -d '{"query": "johndoe", "node_id": "node-123"}' # Expected response: { "success": true, "message": "Success", "data": { "task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } } # Run an email reputation check curl -X POST http://localhost:8000/run/emailrep \ -H "Content-Type: application/json" \ -d '{"query": "user@example.com", "node_id": "node-456"}' # Run a Shodan scan on an IP address curl -X POST http://localhost:8000/run/shodan \ -H "Content-Type: application/json" \ -d '{"query": "8.8.8.8", "node_id": "node-789"}' ``` -------------------------------- ### Receive Real-time Task Updates via WebSocket (Python) Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Establishes a WebSocket connection to receive real-time updates on OSINT task execution using the 'websockets' library. This client subscribes to a Redis pub/sub channel filtered by node_id, providing incremental results as tools discover information. The connection automatically closes upon task completion. ```python # Python WebSocket client example using websockets library import asyncio import websockets import json async def listen_for_updates(node_id: str): uri = f"ws://localhost:8000/ws/transforms/{node_id}" async with websockets.connect(uri) as websocket: try: while True: message = await websocket.recv() payload = json.loads(message) print(f"Update: {payload}") if payload.get("status") == "completed": break except websockets.ConnectionClosed: print("Task completed") # Run the listener asyncio.run(listen_for_updates("node-123")) ``` -------------------------------- ### Receive Real-time Task Updates via WebSocket (JavaScript) Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Establishes a WebSocket connection to receive real-time updates on OSINT task execution. This client subscribes to a Redis pub/sub channel filtered by node_id, providing incremental results as tools discover information. The connection automatically closes upon task completion. ```javascript // JavaScript WebSocket client example const nodeId = "node-123"; const ws = new WebSocket(`ws://localhost:8000/ws/transforms/${nodeId}`); ws.onopen = () => { console.log("Connected to transform updates"); }; ws.onmessage = (event) => { const payload = JSON.parse(event.data); console.log("Update received:", payload); // Example payload: // { // "node_id": "node-123", // "tool": "sherlock", // "status": "in_progress", // "partial_result": {"platform": "GitHub", "found": true} // } }; ws.onclose = () => { console.log("Task completed, connection closed"); }; ws.onerror = (error) => { console.error("WebSocket error:", error); }; ``` -------------------------------- ### WebSocket Transform Updates Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Establishes a WebSocket connection to receive real-time updates for OSINT task execution. The connection filters messages by node_id and delivers incremental results. ```APIDOC ## WS /ws/transforms/{node_id} ### Description Establishes a WebSocket connection to receive real-time updates for OSINT task execution. The connection subscribes to a Redis pub/sub channel and filters messages by `node_id`, delivering incremental results as tools discover information. The connection automatically closes when the task status is "completed". ### Method WebSocket ### Endpoint /ws/transforms/{node_id} ### Parameters #### Path Parameters - **node_id** (string) - Required - The identifier for the OSINT task to receive updates for. #### Query Parameters None #### Request Body None ### Response #### Success Response (WebSocket Message) - **node_id** (string) - The identifier of the task. - **tool** (string) - The OSINT tool currently executing. - **status** (string) - The current status of the tool execution (e.g., "in_progress", "completed"). - **partial_result** (object) - Incremental results discovered by the tool. #### Response Example (JavaScript Client) ```javascript const nodeId = "node-123"; const ws = new WebSocket(`ws://localhost:8000/ws/transforms/${nodeId}`); ws.onopen = () => { console.log("Connected to transform updates"); }; ws.onmessage = (event) => { const payload = JSON.parse(event.data); console.log("Update received:", payload); // Example payload: // { // "node_id": "node-123", // "tool": "sherlock", // "status": "in_progress", // "partial_result": {"platform": "GitHub", "found": true} // } }; ws.onclose = () => { console.log("Task completed, connection closed"); }; ws.onerror = (error) => { console.error("WebSocket error:", error); }; ``` #### Response Example (Python Client) ```python import asyncio import websockets import json async def listen_for_updates(node_id: str): uri = f"ws://localhost:8000/ws/transforms/{node_id}" async with websockets.connect(uri) as websocket: try: while True: message = await websocket.recv() payload = json.loads(message) print(f"Update: {payload}") if payload.get("status") == "completed": break except websockets.ConnectionClosed: print("Task completed") # Run the listener asyncio.run(listen_for_updates("node-123")) ``` ``` -------------------------------- ### Delete Task Result (Bash) Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Removes a specific OSINT task result from the SQLite database using its unique ID. This endpoint is useful for cleaning up old investigation data or removing unnecessary results. ```bash # Delete a specific task result curl -X DELETE http://localhost:8000/delete-task-result/1 # Expected response: { "success": true, "message": "Success", "data": ["SUCCESS"] } ``` -------------------------------- ### Delete Task Result Source: https://context7.com/steelshot-comments/osint-fastapi/llms.txt Removes a specific task result from the SQLite database by its ID. This endpoint is useful for cleaning up old investigation data. ```APIDOC ## DELETE /delete-task-result/{task_id} ### Description Removes a specific task result from the SQLite database by its ID. Use this endpoint to clean up old investigation data or remove results that are no longer needed. ### Method DELETE ### Endpoint /delete-task-result/{task_id} ### Parameters #### Path Parameters - **task_id** (integer) - Required - The unique identifier of the task result to delete. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the outcome of the request. - **data** (array) - An array containing a success message. #### Response Example ```json { "success": true, "message": "Success", "data": ["SUCCESS"] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.