Actions17
Overview
This node interacts with the Petstore API to find pets by their tags. It allows users to filter pets based on one or more tags, making it useful for scenarios where you want to retrieve specific groups of pets categorized by tags. For example, if you manage a pet database and want to list all pets tagged as "friendly" or "small", this operation will return those pets matching the specified tags.
Properties
| Name | Meaning |
|---|---|
| Tags | Tags to filter pets by. This property accepts a JSON array of tag strings. The node will query the Petstore API to find pets that have any of these tags. |
Output
The output contains a JSON field representing an array of pet objects that match the provided tags. Each pet object typically includes details such as the pet's ID, name, category, photo URLs, tags, and status. The exact structure follows the Petstore API response schema for pets.
If the node supports binary data (e.g., pet images), it would be included in the binary output, but based on the provided code and properties, the main output is JSON data describing the pets.
Dependencies
- Requires access to the Petstore API at
https://petstore3.swagger.io/api/v3. - Optionally requires an API authentication token or key configured in n8n credentials to authenticate requests to the Petstore API.
- Uses standard HTTP headers for JSON content (
Accept: application/json,Content-Type: application/json).
Troubleshooting
- No pets returned: Ensure that the tags provided are valid and exist in the Petstore database. An empty result means no pets matched the given tags.
- Authentication errors: If the API requires authentication, verify that the API key or token is correctly set up in the node credentials.
- Invalid JSON in Tags property: The Tags input must be a valid JSON array of strings. Invalid JSON will cause the request to fail.
- Network issues: Check your network connection and ensure that the Petstore API endpoint is reachable from your n8n instance.
Links and References
- Petstore API Documentation
- n8n HTTP Request Node Documentation (for understanding how API calls are made)