Appearance
REST API
The REST API node fetches data from any HTTP REST API endpoint using a GET request. Use it to pull data from external services, the WordPress REST API, or third-party APIs.
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
url | string | -- | Required. The full URL of the API endpoint (e.g., https://api.example.com/items). |
headers | object | {} | HTTP headers to include with the request (e.g., {"Authorization": "Bearer token123"}). |
dataPath | string | -- | Dot-notation path to the data array in the response (e.g., data.items or results). |
fieldMapping | array | -- | Optional field type hints for schema auto-detection. |
orderBy | string | -- | Column to sort results by (applied in PHP after fetch). |
order | string | DESC | Sort direction: ASC or DESC. |
conditions | array | [] | Array of condition objects. Each has field, op, value, and optionally value2 (for BETWEEN). See Table Query: Conditions for full details. Applied in PHP after fetch. |
conditionLogic | string | AND | How multiple conditions combine: AND or OR. |
limit | number | 100 | Maximum rows to return. |
offset | number | 0 | Number of rows to skip. |
Input
This is a source node -- it has no input port.
Output
Returns an array of row objects parsed from the JSON response.
json
[
{ "id": 1, "name": "Widget A", "price": 29.99 },
{ "id": 2, "name": "Widget B", "price": 49.99 }
]How It Works
- The node makes a
GETrequest to the configuredurlusingwp_remote_get()with a 15-second timeout. - The JSON response is decoded.
- If
dataPathis set, the node navigates into the response structure (e.g.,data.itemsextractsresponse["data"]["items"]). - If the result is a single object (not an array), it is wrapped in an array.
- Query options (
orderBy,conditions,limit,offset) are applied in PHP on the fetched data.
TIP
This node supports the enhanced conditions system with multiple conditions, AND/OR logic, and operators like BETWEEN, IN, NOT IN, IS NULL, and IS NOT NULL. See the Table Query: Conditions documentation for full details. Legacy single-condition properties (whereField, whereOp, whereValue) still work for backward compatibility.
Data Path
Many APIs nest the actual data inside a wrapper:
json
{
"status": "ok",
"data": {
"items": [
{ "id": 1, "name": "Item 1" }
]
}
}Set dataPath to data.items to extract the array directly.
Example Use Cases
Fetch from the WordPress REST API
url: "https://mysite.com/wp-json/wp/v2/posts"
dataPath: ""
orderBy: "date"
order: "DESC"
limit: 10Fetch from an external API with authentication
url: "https://api.example.com/products"
headers: {"Authorization": "Bearer sk_live_abc123"}
dataPath: "results"Fetch and filter GitHub repositories
url: "https://api.github.com/users/octocat/repos"
dataPath: ""
whereField: "language"
whereOp: "="
whereValue: "JavaScript"
orderBy: "stargazers_count"
order: "DESC"
limit: 5WARNING
The REST API source node makes a synchronous HTTP request on every page load. For frequently accessed pages, consider caching strategies or using the pipeline deduplication cache (which prevents duplicate requests within the same page render).
TIP
For full HTTP control (POST, PUT, DELETE, custom auth), use the HTTP Request integration node instead.