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

# Search

> Searches the Meta Ad Library by keyword and returns matching ads. Each result includes ad_archive_id, page_name, is_active, publisher_platform, and a snapshot with body text, images, videos, and cta_text. Results cap around 1,500 via GET due to cursor size limits; switch to POST method with body params for larger result sets.

### Query Parameters

| Parameter | Type | Required | Description |
| :- | :- | :- | :- |
| `query` | `string` | Yes | Keyword to search for |
| `sort_by` | `string` | No | Sort by impressions (high to low), or Most Recent (relevancy\_monthly\_grouped). Defaults to impressions. |
| `search_type` | `string` | No | If you want to search by exact phrase or not |
| `ad_type` | `string` | No | Search for all ads or only political and issue ads |
| `country` | `string` | No | This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL. |
| `status` | `string` | No | Status of the ad. Defaults to ACTIVE. |
| `media_type` | `string` | No | Media type of the ad. Defaults to ALL. Meme just means the ad has text and an image. No clue why they call it meme. |
| `start_date` | `string` | No | Impressions start date. Needs to be in YYYY-MM-DD format. |
| `end_date` | `string` | No | Impressions end date. Needs to be in YYYY-MM-DD format. |
| `cursor` | `string` | No | Cursor to paginate through results |
| `trim` | `boolean` | No | Set to true for a trimmed down version of the response |

### Response Example

```json theme={null}
{
  "success": true,
  "data": {
  "searchResults": [
    {
      "ad_archive_id": "1378176106734781",
      "end_date": 1747638000,
      "is_aaa_eligible": false,
      "is_active": true,
      "page_id": "119749581219299",
      "page_name": "Makhumalo",
      "political_countries": [],
      "reach_estimate": null,
      "snapshot": {
        "branded_content": null,
        "page_id": "119749581219299",
        "page_is_deleted": false,
        "page_profile_uri": "https://www.facebook.com/61550737114480/",
        "root_reshared_post": null,
        "byline": null,
        "disclaimer_label": null,
        "page_name": "Makhumalo",
        "page_profile_picture_url": "https://scontent-sjc3-1.xx.fbcdn.net/v/t39.35426-6/499107970_2293645317822147_4932735414928456888_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=106&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=DBNo3Z6ft4AQ7kNvwESjMWN&_nc_oc=AdnZGvglABgVlSJ6UIGIbWgFeUL2LnoBSuMbBvti20zRjb_UUDRzhGxAZ0ip3ye1EQI&_nc_zt=14&_nc_ht=scontent-sjc3-1.xx&_nc_gid=49D7P4N6a4mVqUW8WdOxag&oh=00_AfMEXcKVf3KYJpFehTTToe8MXUZslTHE9P-xS2eyVCeGKA&oe=685A4903",
        "body": {
          "text": "This is my second pair. I only take them off to go to sleep. I put them on first thing in the morning. I am 59 and have neuropathy in my feet, they bring me comfort every day.” -Lydia P.👍👍👍\n❤️These orthopedic shoes provide great comfort and ease foot and knee pain! 😍\n✅ Ideal for wide feet \n✅ comfortable \n✅ they are ideal for everyday life.\nGet Yours Now : https://www.ghemshop.com/products/buckled-square"
        },
        "is_reshared": false,
        "brazil_tax_id": null,
        "caption": "ghemshop.com",
        "cards": [],
        "cta_text": "Shop now",
        "cta_type": "SHOP_NOW",
        "country_iso_code": null,
        "current_page_name": "Makhumalo",
        "display_format": "IMAGE",
        "event": null,
        "images": [
          {
            "original_image_url": "https://scontent-sjc3-1.xx.fbcdn.net/v/t39.35426-6/499507599_4016645891948767_4341363175504946673_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=3EJ6TbZR3GEQ7kNvwErfuF4&_nc_oc=AdkQPpJ9OYN_J3P5xTetGSb9FDCFZzfoLSj59Bbp6s-g5HGg-zTECrgOm8mjkJfk5JE&_nc_zt=14&_nc_ht=scontent-sjc3-1.xx&_nc_gid=49D7P4N6a4mVqUW8WdOxag&oh=00_AfMTuIozb2-VJgGP7NCIx0pG91b48CzMgm_1eT7STgBvew&oe=685A6906",
            "resized_image_url": "https://scontent-sjc3-1.xx.fbcdn.net/v/t39.35426-6/499504336_1222720305887055_488411876974522066_n.jpg?stp=dst-jpg_s600x600_tt6&_nc_cat=104&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=DYkDYH-EJrQQ7kNvwF-b_ov&_nc_oc=Adn2l2fDwHaN4h6W-OxxgoYkb0IUAeCpYH5bociuO_oxVL9L0wLg5vqnNfJa0ehQwqY&_nc_zt=14&_nc_ht=scontent-sjc3-1.xx&_nc_gid=49D7P4N6a4mVqUW8WdOxag&oh=00_AfNkQcMpUNFcM7tF1M5tAHmVwABzLx5QKUU8CFo69NP3Rg&oe=685A4518",
            "watermarked_resized_image_url": "",
            "image_crops": []
          }
        ],
        "link_description": "🔥Best Seller-Last Day Sale 60% OFF🔥 Buckled Square Heel Sandals for Women",
        "link_url": "https://www.ghemshop.com/products/buckled-square",
        "page_categories": [
          "Musician"
        ],
        "page_entity_type": "PERSON_PROFILE",
        "page_is_profile_page": false,
        "page_like_count": 7,
        "title": "🔥Best Seller-Last Day Sale 60% OFF🔥 Buckled Square Heel Sandals for Women",
        "videos": [],
        "additional_info": null,
        "ec_certificates": [],
        "extra_images": [],
        "extra_links": [],
        "extra_texts": [],
        "extra_videos": []
      },
      "total_active_time": null,
      "spend": null,
      "start_date": 1747638000,
      "publisher_platform": [
        "FACEBOOK"
      ],
      "url": "https://www.facebook.com/ads/library?id=1378176106734781",
      "start_date_string": "2025-05-19T07:00:00.000Z",
      "end_date_string": "2025-05-19T07:00:00.000Z"
    }
  ],
  "searchResultsCount": 50001,
  "cursor": "AQHRLKHyzb3ZNTn1O3qr6lG7ncS9gfboI0HWGSDETVUnipTSXVY8E4Wb-568JBicOvYS"
}
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.