JokeAPI
Récupère des blagues multilingues et filtrables depuis JokeAPI (v2) avec des options avancées de personnalisation et permet de récupérer les informations de l'API.
Actions2
Overview
This node integrates with JokeAPI (v2) to retrieve jokes in multiple languages with advanced filtering options. It supports three main operations:
- Get Random Joke: Fetches one or more random jokes based on selected categories, language, joke type, and content filters.
- Get Joke by ID: Retrieves a specific joke or a range of jokes by their numeric IDs.
- Get API Info: Obtains metadata about the JokeAPI such as available categories, flags, and supported languages.
The "Get Joke by ID" operation is useful when you want to fetch a known joke directly by its identifier(s), for example, to display a particular joke stored elsewhere or referenced by ID.
Practical Examples
- Fetching a specific joke in French by its ID to show localized humor.
- Retrieving a range of jokes by IDs to batch process or display them.
- Using the node in workflows that require precise joke retrieval rather than random selection.
Properties
| Name | Meaning |
|---|---|
| Language | Select the language of the joke. Options: English (en), German (de), Spanish (es), French (fr), Portuguese (pt), Czech (cs). |
| Joke ID(s) | The numeric ID or a range of IDs (e.g., "15" or "10-20") specifying which joke(s) to retrieve. This is required for the "Get Joke by ID" operation. |
Output
The node outputs an array of JSON objects representing jokes retrieved from the API. Each joke object contains fields as defined by JokeAPI, typically including:
id: Numeric identifier of the joke.category: Category of the joke (e.g., Programming, Miscellaneous).type: Type of joke ("single" or "twopart").jokeorsetupanddelivery: The joke text itself, either as a single string or split into setup and delivery parts.- Other metadata such as language, flags, and safe-for-work indicators.
If multiple jokes are requested (e.g., a range of IDs), the output will be an array of such joke objects.
The node does not output binary data.
Dependencies
- External HTTP requests to the JokeAPI endpoint at
https://v2.jokeapi.dev. - Optional API credentials can be configured but are not mandatory.
- Requires internet access from the n8n environment to reach the JokeAPI service.
Troubleshooting
- Invalid Joke ID format: The node validates that the Joke ID input contains only numbers and hyphens. If invalid characters are present, it throws an error. Ensure the ID or range is correctly formatted (e.g., "10-20").
- Missing Joke ID: For the "Get Joke by ID" operation, the Joke ID property is required. Omitting it results in an error.
- API Errors: If the JokeAPI returns an error (e.g., invalid ID range, no jokes found), the node surfaces this with detailed messages including any additional info from the API.
- Network Issues: Connectivity problems or unreachable API endpoints result in network error messages. Verify internet connectivity and API availability.
- Search String Restrictions: Although not relevant for "Get Joke by ID", note that the "Search String" filter in other operations requires exactly one specific category selected; otherwise, it throws a validation error.