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

# Facebook Page Search

> Sell facebook.search_pages on AnyAPI: the request your endpoint receives, the response it must return, and what the real-request check judges.

Search Facebook Pages by keyword, optionally narrowed to a location, and get structured page profiles (name, category, followers, contact details).

This page is the seller-facing summary of one catalog API, `facebook.search_pages`. The transport rules that apply to every API a seller serves - signed requests, the response envelope, timeouts, and body limits - are on [the operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md).

## The price you compete with

AnyAPI publishes this API from **\$110.00 per 1,000 requests**. That is the price a buyer sees today, so it is the price your endpoint has to come in under to win traffic.

## The request your endpoint receives

| Field | Type | Required | What it means |
| - | - | - | - |
| `limit` | integer | no | Maximum number of results to return (1-10, default 10). You are billed per result returned, so a lower limit costs less. |
| `location` | string | no | Optional free-text location to narrow the search: a city, province, or country (e.g. 'Berlin'). |
| `query` | string | yes | Keyword to search Facebook Pages for (e.g. 'coffee roasters'). |

> [accordion] Full input JSON Schema
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/facebook.search_pages.input.json",
>   "example": {
>     "query": "nike",
>     "limit": 3
>   },
>   "title": "Facebook page search input",
>   "type": "object",
>   "additionalProperties": false,
>   "required": [
>     "query"
>   ],
>   "properties": {
>     "limit": {
>       "type": "integer",
>       "minimum": 1,
>       "maximum": 10,
>       "description": "Maximum number of results to return (1-10, default 10). You are billed per result returned, so a lower limit costs less."
>     },
>     "query": {
>       "type": "string",
>       "description": "Keyword to search Facebook Pages for (e.g. 'coffee roasters')."
>     },
>     "location": {
>       "type": "string",
>       "description": "Optional free-text location to narrow the search: a city, province, or country (e.g. 'Berlin')."
>     }
>   }
> }
> ```

## The response your endpoint must return

| Field | Type | Always present | What it means |
| - | - | - | - |
| `data` | null or object | yes | |
| `data.items` | array | yes | Matching Facebook Page records for the query. |
| `data.items[].about` | string | no | The page's intro text. |
| `data.items[].adLibraryPageId` | string | no | The page's Facebook Ad Library id, the `pageId` facebook.company\_ads takes. It differs from `id`. Absent when Facebook shows none. |
| `data.items[].adStatus` | string | no | Facebook Ad Library status sentence for the page, e.g. whether it is currently running ads. |
| `data.items[].categories` | array | no | Categories Facebook lists the page under. |
| `data.items[].category` | string | no | The page's primary category (e.g. "Sportswear Store"). Empty when the upstream omits it. |
| `data.items[].coverPhotoUrl` | string | no | Cover photo image URL of the page. |
| `data.items[].createdUtc` | number | no | UTC epoch timestamp in seconds (Unix time) the page was created. Multiply by 1000 for a JS Date in milliseconds. |
| `data.items[].followers` | integer | no | The page's follower count. |
| `data.items[].id` | string | yes | The page's numeric Facebook ID, as a string. |
| `data.items[].image` | string | no | URL of the page's profile picture, a signed CDN URL whose query must be kept. Empty when the upstream omits it. |
| `data.items[].likes` | integer | no | The page's like count. |
| `data.items[].owner` | string | no | Confirmed owner of the page, when Facebook publishes one. |
| `data.items[].pageAlias` | string | no | The page's vanity URL alias, e.g. "nikesportswear". |
| `data.items[].phone` | string | no | The page's public phone number. Empty when the upstream omits it. |
| `data.items[].title` | string | yes | The page's public name. |
| `data.items[].url` | string | yes | Canonical URL of the Facebook Page, with tracking query params stripped. |
| `data.items[].website` | string | no | The page's public website URL. Empty when the upstream omits it. |
| `found` | boolean | yes | Whether any matching pages were returned for the query. |

Extra fields are kept, missing declared fields fail.

> [accordion] Full output JSON Schema
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/facebook.search_pages.output.json",
>   "title": "Facebook page search output",
>   "type": "object",
>   "additionalProperties": false,
>   "required": [
>     "found",
>     "data"
>   ],
>   "properties": {
>     "found": {
>       "type": "boolean",
>       "description": "Whether any matching pages were returned for the query."
>     },
>     "data": {
>       "oneOf": [
>         {
>           "type": "null"
>         },
>         {
>           "type": "object",
>           "additionalProperties": false,
>           "required": [
>             "items"
>           ],
>           "properties": {
>             "items": {
>               "x-anyapi-must-populate": true,
>               "type": "array",
>               "description": "Matching Facebook Page records for the query.",
>               "items": {
>                 "type": "object",
>                 "required": [
>                   "id",
>                   "title",
>                   "url"
>                 ],
>                 "properties": {
>                   "id": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string",
>                     "description": "The page's numeric Facebook ID, as a string."
>                   },
>                   "title": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string",
>                     "description": "The page's public name."
>                   },
>                   "url": {
>                     "x-anyapi-domain": "facebook.com",
>                     "x-anyapi-must-populate": true,
>                     "type": "string",
>                     "description": "Canonical URL of the Facebook Page, with tracking query params stripped."
>                   },
>                   "category": {
>                     "type": "string",
>                     "description": "The page's primary category (e.g. \"Sportswear Store\"). Empty when the upstream omits it."
>                   },
>                   "followers": {
>                     "type": "integer",
>                     "description": "The page's follower count."
>                   },
>                   "likes": {
>                     "type": "integer",
>                     "description": "The page's like count."
>                   },
>                   "phone": {
>                     "type": "string",
>                     "description": "The page's public phone number. Empty when the upstream omits it."
>                   },
>                   "website": {
>                     "type": "string",
>                     "description": "The page's public website URL. Empty when the upstream omits it."
>                   },
>                   "image": {
>                     "x-anyapi-domain": [
>                       "fbcdn.net",
>                       "cdninstagram.com",
>                       "fbsbx.com"
>                     ],
>                     "type": "string",
>                     "description": "URL of the page's profile picture, a signed CDN URL whose query must be kept. Empty when the upstream omits it."
>                   },
>                   "pageAlias": {
>                     "type": "string",
>                     "description": "The page's vanity URL alias, e.g. \"nikesportswear\"."
>                   },
>                   "about": {
>                     "type": "string",
>                     "description": "The page's intro text."
>                   },
>                   "coverPhotoUrl": {
>                     "x-anyapi-domain": [
>                       "fbcdn.net",
>                       "cdninstagram.com",
>                       "fbsbx.com"
>                     ],
>                     "type": "string",
>                     "description": "Cover photo image URL of the page."
>                   },
>                   "createdUtc": {
>                     "type": "number",
>                     "description": "UTC epoch timestamp in seconds (Unix time) the page was created. Multiply by 1000 for a JS Date in milliseconds."
>                   },
>                   "adStatus": {
>                     "type": "string",
>                     "description": "Facebook Ad Library status sentence for the page, e.g. whether it is currently running ads."
>                   },
>                   "adLibraryPageId": {
>                     "type": "string",
>                     "description": "The page's Facebook Ad Library id, the `pageId` facebook.company_ads takes. It differs from `id`. Absent when Facebook shows none."
>                   },
>                   "owner": {
>                     "type": "string",
>                     "description": "Confirmed owner of the page, when Facebook publishes one."
>                   },
>                   "categories": {
>                     "type": "array",
>                     "items": {
>                       "type": "string"
>                     },
>                     "description": "Categories Facebook lists the page under."
>                   }
>                 }
>               }
>             }
>           }
>         }
>       ]
>     }
>   }
> }
> ```

## Fields that must never come back empty

* `id`
* `items`
* `title`
* `url`

The repository marks these fields as ones every source must be able to fill. An empty value is only correct when the entity itself genuinely has nothing there.

## Not found, and how it differs from empty

When the entity does not exist, answer 2xx with the not-found shape:

```json theme={"dark"}
{
  "found": false,
  "data": null
}
```

An empty list is not a not-found: when the entity exists and has nothing to return, answer 2xx with `found: true` and an empty `items` array.

This output schema declares no `reason` field, so `found: false` is the whole not-found answer.

## Example request

```json theme={"dark"}
{
  "query": "nike",
  "limit": 3
}
```

The registration tests send this example to your endpoint, with the API's other test inputs. After that, the real-request check sends your endpoint real past customer inputs, and an AI reviewer compares each answer with AnyAPI's own answer to the same input.

## Next

* [The operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md) for signing, budgets, and the real-request check.
* [Every API open to sellers](https://getanyapi.com/docs/sell/apis/index.md).
* Want to sell an API that is not on that list? Email [support@getanyapi.com](mailto:support@getanyapi.com).


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