Foreplay API icon

Foreplay API

Interact with the Foreplay API

Overview

This node integrates with the Foreplay API to search for advertisements based on various filtering criteria. It is designed to retrieve ad data such as active status, display format, publisher platform, niches, market target, languages, and date ranges. This node is useful for marketers, analysts, or developers who want to programmatically access and analyze ad campaigns from multiple platforms in a structured way.

Practical examples include:

  • Fetching all live ads within a specific date range for competitive analysis.
  • Filtering ads by display format (e.g., video or carousel) to study creative trends.
  • Retrieving ads targeted at specific markets or languages to tailor marketing strategies.

Properties

Name Meaning
Start Date Start date (inclusive) to filter ads. Accepts formats like YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS, or YYYY-MM-DD HH:MM:SS.
End Date End date (inclusive) to filter ads. Same accepted formats as Start Date.
Live Status Filter ads by live status. Options: All, Live (Active), Not Live.
Display Format Filter ads by one or more display formats. Options include Carousel, DCO, DPA, Event, Image, Multi Images, Multi Medias, Multi Videos, Page Like, Text, Video.
Publisher Platform Filter ads by one or more publisher platforms. Options include Audience Network, Facebook, Instagram, LinkedIn, Messenger, Threads, TikTok, YouTube.
Niches Filter ads by one or more niches. Options include Accessories, App/Software, Beauty, Business/Professional, Education, Entertainment, Fashion, Food/Drink, Health/Wellness, Home/Garden, Jewelry/Watches, Other, Parenting, Pets, Real Estate, Service Business.
Market Target Filter ads by market target. Options: B2B, B2C.
Languages Filter ads by one or more languages. Options include Dutch/Flemish, English, French, German, Italian, Japanese, Latvian, Lithuanian, Polish, Portuguese, Romanian/Moldavian/Moldovan, Serbian, Slovene, Spanish/Castilian, Swedish.
Cursor Cursor string used for pagination to fetch subsequent pages of results.
Limit Maximum number of results to return. Minimum value is 1. Default is 5.
Order Order of results. Options: Newest, Oldest, Longest Running, Most Relevant. Default is Newest.

Output

The node outputs an array of JSON objects under the json field. Each object contains a response property which holds the raw response data returned by the Foreplay API for the requested ads. The structure of this response depends on the API but generally includes details about each ad matching the search criteria.

No binary data output is indicated by the code.

Dependencies

  • Requires an API key credential for authenticating with the Foreplay API.
  • The base URL for the API must be configured in the credentials.
  • Uses HTTP requests with authentication handled internally by n8n's helper methods.

Troubleshooting

  • Invalid operation error: If the specified operation is not recognized, the node throws an "Invalid operation" error. Ensure the operation parameter is set correctly to "searchAds" or other supported operations.
  • Authentication errors: If the API key or base URL is missing or incorrect, HTTP requests will fail. Verify that the API credentials are properly configured.
  • Empty or invalid parameters: Some filters require valid input formats (e.g., dates). Incorrect formats may cause the API to reject the request or return no results.
  • Pagination issues: Using the cursor incorrectly may result in repeated or missing data. Use the cursor value exactly as returned by previous responses for pagination.
  • Rate limits or API downtime: The node relies on external API availability; network issues or rate limiting can cause failures.

Links and References

Discussion