API Node#
This is a node that performs tasks such as calling external APIs to retrieve data or integrating with external systems. It includes API request and response handling features.Body#
Enter additional data to be sent to the server during the API request in JSON format.
Mainly used in POST and PUT requests, GET requests generally do not include a Body.
đź’ˇ Example Code#
This is a basic Body example that sends “name, email, age” data. Required field names and data structures may vary depending on the API.{
"name": "Hello World",
"email": "HW@example.com",
"age": 30
}
Defines the HTTP headers to include in the request.
Used to deliver authentication information to the server or to indicate the format of the request body.
đź’ˇ Example Code#
{
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
Authorization#
Configures the authentication method required for API access.
Supports Basic and Bearer authentication methods.
| Item | Required Conditions | Optional or Not Needed | Main Purpose |
|---|
| Body | When data must be sent to the server in POST or PUT requests | For simple lookup requests such as GET, DELETE | Input additional data to be sent to the server |
| Header | When the server explicitly requires the request or response data format or when authentication information must be included in the header | Public APIs that do not require authentication, or when authentication is handled through query parameters | Specify request/response data format and deliver authentication information |
| Authorization | When the API requires user authentication (Bearer token, Basic auth, API Key header, etc.) | When calling public APIs that do not require authentication or when authentication is handled via URL parameters | Verify API access permissions and user authentication |
Timeout#
Sets the maximum waiting time when calling an API.
Example Usage: SerpApi Google Flights Integration#
Premise: The variables departure_id, arrival_id, outbound_date, and return_date have already been created in Variable Declaration, and each value has been assigned through a Variable Assignment Node during a multi-turn process.
Example Scenario#
When designing an agent that retrieves flight information, the API node connects to an external flight search service and retrieves real data.When the user inputs a request such as “Find me a flight from Incheon to Tokyo on November 10. I think I will return on November 19,” the LLM node recognizes from the sentence the departure location (Incheon), arrival location (Tokyo), departure date (November 10), and return date (November 19), and stores these values into respective variables via the variable declaration and assignment nodes.Using these stored variable values, the API node sends a real flight search request to the external flight search API. The returned flight list, prices, schedules, and other details can be used by subsequent nodes (LLM, RAG nodes).
1) Pre-check — Review required/optional parameters and constraints in the external API documentation#
URL: https://serpapi.com/search?engine=google_flights
| Item | Description |
|---|
Required parameters (required) | engine, api_key |
Optional parameters (optional) | departure_id, arrival_id |
2) Query Parameter Mapping#
| SerpApi Parameter | Description | Variable to Bind in Node |
|---|
engine | Specifies the engine used | google_flights (fixed value) |
departure_id | Identifier for the departure airport/region | {{custom_variables.departure_id.value}} |
arrival_id | Identifier for the arrival airport/region | {{custom_variables.arrival_id.value}} |
outbound_date | Departure date (YYYY-MM-DD) | {{custom_variables.outbound_date.value}} |
return_date | Return date (YYYY-MM-DD, optional) | {{custom_variables.return_date.value}} |
api_key | SerpApi API Key | - |
URL: https://serpapi.com/search.json
Leave empty because this is a GET request
No additional headers needed (SerpApi passes the API key through query parameters)
No additional configuration (authentication handled via the api_key query parameter)
Set according to service requirements (e.g., 5000ms)
Modified at 2025-11-14 09:09:25