Leverage this powerful n8n workflow to automatically discover hidden API endpoints by analyzing website JavaScript files using advanced predefined regex and a self-validating AI agent. One of the best n8n templates for technical web reconnaissance.
Download this n8n workflow template and start using it instantly.






















Security Researchers and Penetration Testers mapping application attack surfaces.
Developers requiring programmatic access to services that lack documented public APIs.
Technical professionals looking for advanced n8n templates combining web scraping, core logic, and generative AI.
n8n users interested in building complex AI Agent pipelines and custom regex validation loops.
Modern web applications often rely on internal API endpoints embedded within client-side JavaScript, which are rarely documented publicly. This sophisticated n8n workflow solves the challenge of discovering these hidden endpoints by providing a dual-pronged approach.
First, it uses a robust predefined regex pattern to quickly extract potential endpoint strings from all relevant JS files. Second, it utilizes a powerful AI Agent (powered by models like Claude 3.7 Sonnet) to iteratively generate highly specific, accurate regex expressions based on an initial LLM analysis (Gemini 2.5 Pro). This n8n workflow features a crucial self-validation loop where the Agent tests its generated regex against the source data, ensuring high accuracy.
By merging the results from both the standard regex extraction and the refined AI extraction, this n8n template guarantees maximum coverage, providing a comprehensive final list exported to an XLSX file for easy analysis. This is an extremely valuable n8n node arrangement for technical web analysis.
This advanced n8n workflow executes in several stages, initiated by the manual n8n trigger:
To install and run this n8n workflow, follow these steps:
in the URL field with your target website. Start API Discovery (Manual Trigger n8n trigger): The entry point to the entire process, initiating the website analysis.
Fetch Website HTML (HTTP Request n8n node): Responsible for initiating the web scrape, fetching the main HTML page content.
Extract URLs of JS files (HTML n8n node): Extracts all script source URLs from the fetched HTML using a configured CSS selector.
Keep Relevant JS Files (Filter n8n node): Filters the extracted URLs, keeping only those likely to contain application logic and API calls (e.g., local or bundle paths).
Extract API Endpoints (Set n8n node): Applies the initial, broad regex to the JS content to find and clean potential API endpoint strings.
AI Endpoints Analysis (HTTP Request n8n node): Connects to the OpenRouter API to send the JS content to a powerful LLM (Gemini 2.5 Pro) for detailed semantic analysis.
Save Endpoints File(s) (Read/Write File n8n node): Persists the LLM analysis results onto the n8n drive, creating temporary files necessary for the subsequent Agent validation process.
Create Endpoints Regex With AI (Langchain Agent n8n node): The core AI component. This agent utilizes system prompts and tools (including the Validation sub-workflow) to generate a precise, optimized n8n expression (regex).
Validate LLM Regex (Langchain Tool Workflow n8n node): Executes a sub-workflow, triggered by the Agent, to test the validity of the generated regex. This self-correction loop is key to the high performance of this n8n workflow.
Execute LLM Regex (Set n8n node): Executes the validated, AI-generated n8n expression on the source data using $evaluateExpression() to extract the final set of LLM-verified endpoints.
Merge Original And LLM Endpoints (Merge n8n node): Combines the endpoint lists derived from both the initial regex and the refined LLM regex paths, creating a single comprehensive dataset for the final output.
Export Comparison Results To Excel (Convert to File n8n node): Converts the final merged data into an easy-to-read XLSX format.
Discover hidden YouTube trends and outlier videos in your niche using this automated n8n workflow. It scrapes data via Apify, analyzes video structure with Mistral AI, and stores insights in Airtable.

Use this powerful n8n workflow to automatically scrape GitHub developer profiles, enrich contact data using Hunter.io, score leads, and sync unique profiles directly to a Google Sheets CRM.

Use this powerful n8n workflow to automate intelligent sales prospecting. Discover decision-makers based on organizational responsibility using Octave AI and save leads directly to Airtable. Install this n8n templates quickly.

Use this automated n8n workflow to scrape trending hashtags and topics using Bright Data and OpenAI, instantly creating structured Trello cards for your content team.

Use this powerful n8n workflow to automatically lookup company data (like name and location) using the uProc n8n node, simplifying data enrichment and verification processes.








































