> ## Documentation Index
> Fetch the complete documentation index at: https://agnt.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Search Ads Pages (POST)

> This endpoint retrieves detailed information about ad pages based on a search query, returning up to 26 ads per request. Use the end_cursor parameter to retrieve additional ads if needed.



## OpenAPI

````yaml /openapi/facebook.openapi.json post /v1/data/facebook/fetch_search_ads_pages
openapi: 3.0.0
info:
  title: agntdata Facebook API
  description: >-
    Unlock Facebook data effortlessly with our powerful scraping tools. Extract
    page names, URLs, contact info, likes, followers, posts, comments,
    Marketplace listings, and meta ads metrics. Perfect for market research,
    trend analysis, and optimizing marketing strategies.
  version: 1.0.0
  contact:
    name: agntdata
    url: https://agntdata.dev
servers:
  - url: https://api.agntdata.dev
    description: agntdata API
security:
  - ApiKeyAuth: []
tags:
  - name: Facebook Marketplace Listings
    description: ''
  - name: Facebook Posts Details
    description: ''
  - name: Facebook Search
    description: >-
      The Facebook Search API group provides a comprehensive set of endpoints to
      perform various types of searches across Facebook data, including posts,
      pages, people, and places. These endpoints enable users to retrieve
      targeted information based on specific query parameters and filters such
      as location, user identifiers, and other relevant attributes.
  - name: Meta Ads Library Search
    description: >-
      The Meta Ads Library Search allows you to search and retrieve detailed
      information from Meta’s Ad Library, providing insights into active and
      inactive ad campaigns across Facebook and Instagram. This tool is ideal
      for marketing analysis, competitor research, and understanding ad
      strategies.
  - name: Facebook Pages Details/Posts
    description: ''
  - name: 'Facebook Groups Details/Posts '
    description: ''
  - name: Facebook Download Media
    description: >-
      Download media (images, videos, audio) from Facebook URLs. Returns file
      size in MB and media type.
paths:
  /v1/data/facebook/fetch_search_ads_pages:
    post:
      tags:
        - Meta Ads Library Search
      summary: Fetch Search Ads Pages (POST)
      description: >-
        This endpoint retrieves detailed information about ad pages based on a
        search query, returning up to 26 ads per request. Use the end_cursor
        parameter to retrieve additional ads if needed.
      operationId: Fetch_Search_Ads_Pages__POST
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  default: ''
                  description: Search query string
                ad_page_id:
                  type: string
                  default: '1633779800049051'
                  description: Facebook Ad Page ID. Used only if query is not provided.
                country:
                  type: string
                  default: ALL
                  description: Country filter (e.g. ALL, US, GB)
                activeStatus:
                  type: string
                  default: ALL
                  description: Filter by active status (e.g. ALL, ACTIVE, INACTIVE)
                end_cursor:
                  type: string
                  default: ''
                  description: Pagination cursor for next page of results
                after_time:
                  type: string
                  default: ''
                  description: Filter ads created after this time
                before_time:
                  type: string
                  default: ''
                  description: Filter ads created before this time
                sort_data:
                  type: string
                  default: ''
                  description: Sort order for results
            example:
              query: ''
              ad_page_id: '1633779800049051'
              country: ALL
              activeStatus: ALL
              end_cursor: ''
              after_time: ''
              before_time: ''
              sort_data: ''
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Post_facebook_fetch_search_ads_pages_Response
        '400':
          description: Bad request
        '401':
          description: Unauthorized - invalid API key
        '429':
          description: Rate limit exceeded
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Post_facebook_fetch_search_ads_pages_Response:
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Bearer token. Pass your agntdata API key as: Authorization: Bearer
        agnt_live_...

````