This workflow creates an API endpoint for three operations: fetching albums from JSONPlaceholder, scraping web page titles, and retrieving GitHub starred repositories. Key nodes include Webhook (handles POST requests at /api/http-request), Input Validation (processes operation, URL, and GitHub user), Check Operation Type (validates operation), Route Operation (directs to albums, scrape, or github_stars), HTTP Request nodes (interact with APIs or websites), and response nodes (Success Response, Error Response). Uses JSONPlaceholder and GitHub APIs. Customize by updating the github_user in the Input Validation.\n\nSetup Requirements and Configuration: Install n8n from n8n.io for self-hosting or sign up at cloud.n8n.io. No API credentials are needed, as JSONPlaceholder and GitHub’s public API (for starred repositories) don’t require authentication for read-only access. Import the JSON workflow in n8n. Configure the Webhook node to use HTTPS and path ‘api/http-request’ under Settings > Webhook. Ensure your server supports HTTPS for secure webhook access. For local testing, use a tunneling service like ngrok to make the webhook publicly accessible. Verify internet connectivity for API requests to JSONPlaceholder and GitHub.\n\nTesting and Deployment Steps: Activate the workflow to get the Webhook URL (e.g., https://your-n8n-instance/api/http-request). Test with a POST request, e.g., { "operation": "albums" }, { "operation": "scrape", "url": "https://example.com" }, or { "operation": "github_stars", "github_user": "octocat", "page": 1, "per_page": 10 }. Success responses return JSON with operation-specific data (e.g., album list, page title, or starred repositories). Error response (HTTP 400) occurs for invalid operations. Check n8n logs for issues like ‘Webhook not accessible’ or ‘API request failed.’ Validate outputs: ensure albums return a list, scrape returns title/description, and github_stars returns repository data. Debug using n8n logs for network or webhook issues. Ensure stable internet for reliable API and webhook performance. Update the github_user or URL in the POST body for different queries.
$6.99
Workflow steps: 15
Integrated apps: webhook, set, if