This article contains affiliate links. If you buy through them, we may earn a commission at no extra cost to you.
n8n Basics: Connect Any API — Step by Step
Most people assume that working with APIs requires a developer background, a terminal window, and a lot of patience. The truth? With n8n, you can connect virtually any API visually — no code required. This guide walks you through exactly how to do it, from your first node to a fully working workflow.
What Is an API and Why Does It Matter?
An API (Application Programming Interface) is essentially a bridge between two software applications. When you book a flight, your travel app talks to the airline's API. When Slack sends you a notification, it's using an API call. APIs power almost every modern digital interaction.
The problem has always been accessing those APIs without writing custom code. That's exactly the gap that n8n fills. Its visual workflow builder lets you send and receive API requests using a drag-and-drop interface — without touching a single line of code.
What You Need Before You Start
- An n8n account — cloud or self-hosted both work perfectly
- An API endpoint — this is the URL you'll send requests to
- API credentials — usually an API key or OAuth token from the service you want to connect
For this tutorial, we'll use a simple public API to demonstrate the core concepts. Once you understand the pattern, you can apply it to any API — whether it's OpenAI, Airtable, Stripe, or a custom internal tool.
Step 1: Create a New Workflow in n8n
Log into your n8n dashboard and click "New Workflow". You'll see an empty canvas — this is where your automation lives. Every workflow starts with a trigger node, which defines when your workflow runs.
For API testing, start with a Manual Trigger node. This lets you fire the workflow with a button click, which is perfect while you're building and experimenting.
Step 2: Add an HTTP Request Node
The HTTP Request node is the core tool for connecting any API in n8n. Click the "+" icon to add a new node, then search for "HTTP Request".
Once added, you'll see a configuration panel with the following key fields:
- Method — GET, POST, PUT, DELETE, PATCH (choose based on what the API expects)
- URL — the full API endpoint, e.g.
https://api.example.com/data - Authentication — where you'll add your API key or token
- Headers — additional request headers if required
- Body / Parameters — the data you're sending with your request
Step 3: Configure Authentication
Most APIs require authentication. In n8n, you can handle this in several ways:
API Key (Header)
Go to the Authentication section of the HTTP Request node. Select "Header Auth", then enter the header name (e.g. Authorization) and the value (e.g. Bearer YOUR_API_KEY). This is the most common setup.
Query Parameter
Some APIs accept the key as a URL parameter. Select "Query Auth" and add the key name and value. The n8n node appends it to your URL automatically.
OAuth2
For services like Google or Salesforce, n8n supports full OAuth2 flows. Select "OAuth2" in the auth section and follow the credential setup wizard — it handles the token exchange for you.
Step 4: Send Your First Request
Once your URL and authentication are configured, click "Test Step". The n8n canvas will display the full API response in a structured JSON panel on the right. You can see every field returned, which makes it easy to understand what data you're working with.
If you get a 200 OK response — congratulations, you've successfully connected your first API. If you see an error, check the status code:
- 401 — Authentication failed. Double-check your API key.
- 403 — Forbidden. Your key may lack the required permissions.
- 404 — Wrong URL. Verify the endpoint in the API documentation.
- 429 — Rate limited. Slow down your requests or check your plan limits.
Step 5: Use the API Response in Your Workflow
Once n8n retrieves data from the API, you can pipe it into other nodes. For example:
- Send a Slack message with the response data
- Write the result to an Airtable or Google Sheet row
- Feed the output into an AI node for summarisation or classification
- Trigger a conditional branch based on a specific field value
Click the "+" after your HTTP Request node and connect it to whatever destination makes sense for your use case. The n8n expression editor (using {{ }} syntax) lets you reference any field from the API response directly in downstream nodes.
Step 6: Handle POST Requests and Send Data
Not all APIs are about receiving data — many require you to send it. For POST requests in n8n, switch the method to "POST" and expand the Body section.
You can send data as:
- JSON — the most common format for modern REST APIs
- Form Data — used by older APIs or file uploads
- Raw — for custom formats or GraphQL queries
Use the expression editor to dynamically populate body fields from earlier nodes in your n8n workflow — making every API call personalised and data-driven.
Pro Tips for API Workflows in n8n
- Use the "Respond to Webhook" node if you want to build your own API endpoint inside n8n
- Paginate with the Loop Over Items node when an API returns data across multiple pages
- Store credentials centrally in the n8n credentials manager so you can reuse them across workflows
- Use error handling nodes to catch failed API calls and send alerts instead of silent failures
Start Connecting APIs Today
APIs are the backbone of modern automation — and n8n makes them accessible to anyone, regardless of technical background. Whether you're pulling data from a CRM, pushing results to a database, or chaining multiple services together, the HTTP Request node is your universal key.
Start with one API, run your first successful request, and you'll quickly see how every digital tool becomes a building block in your n8n automation stack.
This post was created with tools we use and recommend: n8n for workflow automation, Turbotic as an AI-native automation alternative, ElevenLabs for AI voiceover, Placid for visual content creation, and Hostinger for reliable VPS hosting. Some links are affiliate links.