> **For coding agents and LLMs:** This is one page from the Social Fetch docs (markdown export). The sections below mirror the orientation block in [`/llms.txt`](https://www.socialfetch.dev/llms.txt); use [`/llms.json`](https://www.socialfetch.dev/llms.json) when you need a structured operation inventory. The catalog covers documented operations with on-site reference pages.

## This page

- **On-site (HTML):** [https://www.socialfetch.dev/docs/api/v1/facebook/profiles/get](https://www.socialfetch.dev/docs/api/v1/facebook/profiles/get)
- **Markdown (.mdx) URL:** [https://www.socialfetch.dev/docs/api/v1/facebook/profiles/get.mdx](https://www.socialfetch.dev/docs/api/v1/facebook/profiles/get.mdx)

## API base URL and authentication

- **API origin (from OpenAPI `servers`):** `https://api.socialfetch.dev`
- **Authentication:** send `x-api-key: sfk_...` on `/v1/**` routes unless the operation is explicitly anonymous (check OpenAPI `security`, the [API reference hub](https://www.socialfetch.dev/docs/api.mdx), [`/llms.txt`](https://www.socialfetch.dev/llms.txt), or [`/llms.json`](https://www.socialfetch.dev/llms.json) for each route).
- **OpenAPI JSON:** [https://www.socialfetch.dev/openapi.json](https://www.socialfetch.dev/openapi.json)

## Recommended docs entrypoints (this site)

- [Documentation overview](https://www.socialfetch.dev/docs.mdx) — top-level orientation (markdown).
- [Quickstart](https://www.socialfetch.dev/docs/quickstart.mdx) — authenticate with `x-api-key`, validate auth with `whoami`, and understand the JSON envelope.
- [SDK](https://www.socialfetch.dev/docs/sdk.mdx) — official TypeScript SDK guide, including `SocialFetchClient`, `Result`, and `unwrap()`.
- [SDK reference](https://www.socialfetch.dev/docs/sdk-reference.mdx) — exhaustive SDK method inventory and route mapping for agents, tooling, and power users.
- [Choose the right endpoint](https://www.socialfetch.dev/docs/choose-endpoint.mdx) — task-oriented route selection for smoke tests, profiles, list endpoints, and single-item lookups.
- [Capability matrix](https://www.socialfetch.dev/docs/capability-matrix.mdx) — fast comparison of identifiers, pagination, outcomes, media download, and SDK coverage.
- [`/llms.json`](https://www.socialfetch.dev/llms.json) — structured machine-readable operation inventory with parameter names, pagination, outcomes, credits, and SDK mapping.
- [API reference hub](https://www.socialfetch.dev/docs/api.mdx) — human-friendly index of operations with links into generated pages.
- [Errors](https://www.socialfetch.dev/docs/errors.mdx) — shared error envelope and HTTP status guidance.
- [Credits](https://www.socialfetch.dev/docs/credits.mdx) — metering, `402`, and planning batch jobs.
- Outcome semantics such as `found`, `not_found`, and `private` are documented in [Errors](https://www.socialfetch.dev/docs/errors.mdx) and on operation pages when present in the OpenAPI contract.

## Markdown docs convention

- Every docs page has a markdown twin: append **`.mdx`** to the docs pathname (for example `/docs/quickstart` → `/docs/quickstart.mdx`).
- Agents that send `Accept: text/markdown` on `/docs/**` HTML URLs may receive markdown directly (same URL, `Vary: Accept`).

---
# Get Facebook profile (https://www.socialfetch.dev/docs/api/v1/facebook/profiles/get)

## Summary

Looks up a Facebook public profile or page by full URL. Outcomes such as found, private, or not found are indicated in `data.lookupStatus`.

**Tags:** `Facebook`

## HTTP

- **Method:** GET
- **Path:** `/v1/facebook/profiles`
- **Base URL:** `https://api.socialfetch.dev`

## Capability summary

- **SDK mapping:** `client.facebook.getProfile({ url, includeBusinessHours? })`
- **Accepted identifiers:** `url` (query)
- **Pagination:** none
- **Business outcome field:** `data.lookupStatus` with values `found`, `private`, `not_found`

## Authentication

- **`x-api-key`**: API key (`sfk_...`)

## Parameters

### `url` (query)

- **Required:** yes
- **Constraints:** type `string`; minLength: 1; maxLength: 4096
- **Description:** Facebook public profile or page URL to look up.

### `includeBusinessHours` (query)

- **Required:** no
- **Constraints:** type `boolean`
- **Description:** Optional: include structured business hours in the response when available.

## Responses (status codes)

- **200**: Lookup result. Check `data.lookupStatus` for `found`, `private`, or `not_found`.
- **400**: Invalid query or bad request
- **401**: Missing or invalid API key
- **402**: Insufficient credits
- **500**: Unexpected or billing error
- **502**: Lookup could not be completed from the response (unexpected or invalid data).
- **503**: Service temporarily unavailable; safe to retry with backoff.

## Response body (200)

Lookup result. Check `data.lookupStatus` for `found`, `private`, or `not_found`.

### Field outline

- **data** (required) — type `object`. Endpoint-specific response payload.
  - **lookupStatus** (required) — type `string`; enum: found, private, not_found. Whether the profile was found, private, or not found.
  - **profile** (required) — type `object`; nullable. Profile details when available.
    - **platform** (required) — type `string`; enum: facebook. Social platform for this profile.
    - **profileType** (required) — type `string`; enum: person, business. Whether the lookup resolved to a personal profile or business page.
    - **displayName** (required) — type `string`; nullable. Public display name shown on the Facebook profile or page.
    - **profileUrl** (required) — type `string`; minLength: 1. Canonical public Facebook profile or page URL.
    - **avatarUrl** (required) — type `string`; nullable. Best available avatar image URL.
    - **coverImageUrl** (required) — type `string`; nullable. Best available cover image URL.
    - **platformUserId** (optional) — type `string`. Facebook profile or page id when available.
    - **gender** (optional) — type `string`; enum: female, male, unknown, null; nullable. Gender label when available for personal profiles.
  - **metrics** (required) — type `object`; nullable. Profile metrics when available.
    - **likes** (required) — type `integer`; minimum: 0; nullable. Page likes count when available.
    - **followers** (required) — type `integer`; minimum: 0; nullable. Page follower count when available.
    - **ratingCount** (required) — type `integer`; minimum: 0; nullable. Number of public ratings or reviews when available.
  - **contact** (required) — type `object`; nullable. Public contact information when available.
    - **address** (required) — type `string`; nullable. Public business address when available.
    - **email** (required) — type `string`; nullable. Public contact email when available.
    - **phone** (required) — type `string`; nullable. Public phone number when available.
    - **website** (required) — type `string`; nullable. Primary public website URL when available.
  - **business** (required) — type `object`; nullable. Business-page-specific details when available.
    - **intro** (required) — type `string`; nullable. Short public introduction shown on the page when available.
    - **category** (required) — type `string`; nullable. Primary category label when available.
    - **services** (required) — type `string`; nullable. Service summary when available.
    - **priceRange** (required) — type `string`; nullable. Displayed price range when available.
    - **ratingText** (required) — type `string`; nullable. Public rating summary text when available.
    - **isActive** (optional) — type `boolean`. Whether the page is marked as an active business page.
    - **createdDateText** (optional) — type `string`; nullable. Human-readable page creation date when available.
    - **adLibraryStatus** (optional) — type `string`; nullable. Advertising activity summary when available.
    - **adLibraryPageId** (optional) — type `string`; nullable. Facebook page id shown in the ad library when available.
    - **hours** (optional) — type `object`. Structured business hours when requested and available.
      - **monday** (optional) — type `object`. Business hours for one weekday.
        - **open** (required) — type `string`; nullable. Opening time for the first interval when available.
        - **close** (required) — type `string`; nullable. Closing time for the last interval when available.
        - **intervals** (required) — type `array`. Structured opening intervals for the day.
          - _items:_
        - **text** (required) — type `string`. Human-readable business-hours text for the day.
      - **tuesday** (optional) — type `object`. Business hours for one weekday.
        - **open** (required) — type `string`; nullable. Opening time for the first interval when available.
        - **close** (required) — type `string`; nullable. Closing time for the last interval when available.
        - **intervals** (required) — type `array`. Structured opening intervals for the day.
          - _items:_
        - **text** (required) — type `string`. Human-readable business-hours text for the day.
      - **wednesday** (optional) — type `object`. Business hours for one weekday.
        - **open** (required) — type `string`; nullable. Opening time for the first interval when available.
        - **close** (required) — type `string`; nullable. Closing time for the last interval when available.
        - **intervals** (required) — type `array`. Structured opening intervals for the day.
          - _items:_
        - **text** (required) — type `string`. Human-readable business-hours text for the day.
      - **thursday** (optional) — type `object`. Business hours for one weekday.
        - **open** (required) — type `string`; nullable. Opening time for the first interval when available.
        - **close** (required) — type `string`; nullable. Closing time for the last interval when available.
        - **intervals** (required) — type `array`. Structured opening intervals for the day.
          - _items:_
        - **text** (required) — type `string`. Human-readable business-hours text for the day.
      - **friday** (optional) — type `object`. Business hours for one weekday.
        - **open** (required) — type `string`; nullable. Opening time for the first interval when available.
        - **close** (required) — type `string`; nullable. Closing time for the last interval when available.
        - **intervals** (required) — type `array`. Structured opening intervals for the day.
          - _items:_
        - **text** (required) — type `string`. Human-readable business-hours text for the day.
      - **saturday** (optional) — type `object`. Business hours for one weekday.
        - **open** (required) — type `string`; nullable. Opening time for the first interval when available.
        - **close** (required) — type `string`; nullable. Closing time for the last interval when available.
        - **intervals** (required) — type `array`. Structured opening intervals for the day.
          - _items:_
        - **text** (required) — type `string`. Human-readable business-hours text for the day.
      - **sunday** (optional) — type `object`. Business hours for one weekday.
        - **open** (required) — type `string`; nullable. Opening time for the first interval when available.
        - **close** (required) — type `string`; nullable. Closing time for the last interval when available.
        - **intervals** (required) — type `array`. Structured opening intervals for the day.
          - _items:_
        - **text** (required) — type `string`. Human-readable business-hours text for the day.
- **meta** (required) — type `object`. Metadata describing the request and billing outcome.
  - **requestId** (required) — type `string`; minLength: 1. Unique request identifier for tracing this API call.
  - **creditsCharged** (required) — type `integer`; minimum: 0. Credits charged for this request.
  - **version** (required) — type `string`; enum: v1. Public API version that served the response.

### Example JSON (found)

```json
{
  "data": {
    "lookupStatus": "found",
    "profile": {
      "platform": "facebook",
      "profileType": "person",
      "displayName": "Carly Cross",
      "profileUrl": "https://www.facebook.com/carly.cross.5",
      "avatarUrl": "https://example.com/avatar.jpg",
      "coverImageUrl": "https://example.com/cover.jpg",
      "platformUserId": "pfbid02sEc1nJvcFqcQrMPgnv4zaL8idwhenjVNNBRQe7HV2yDMXrJDW7b9YfBpMUKcVwffl",
      "gender": "female"
    },
    "metrics": null,
    "contact": null,
    "business": null
  },
  "meta": {
    "requestId": "req_01example_found",
    "creditsCharged": 1,
    "version": "v1"
  }
}
```

### Example JSON (found_business)

```json
{
  "data": {
    "lookupStatus": "found",
    "profile": {
      "platform": "facebook",
      "profileType": "business",
      "displayName": "Mantraindian",
      "profileUrl": "https://www.facebook.com/mantraindianfolsom",
      "avatarUrl": "https://example.com/avatar.jpg",
      "coverImageUrl": "https://example.com/cover.jpg",
      "platformUserId": "100088017857524",
      "gender": "unknown"
    },
    "metrics": {
      "likes": 4228,
      "followers": 4200,
      "ratingCount": null
    },
    "contact": {
      "address": "1870 Prairie City Rd, Suite 500, Folsom, CA, United States, California",
      "email": "contact@mantraindian.com",
      "phone": "+1 916-999-1749",
      "website": "https://www.mantraindian.com/"
    },
    "business": {
      "intro": "Indian Vegan & Vegetarian Restaurant",
      "category": "Restaurant",
      "services": "Delivery · Takeaway · Dine in…",
      "priceRange": "$$",
      "ratingText": "Not yet rated (1 review)",
      "isActive": false,
      "createdDateText": "November 25, 2022",
      "adLibraryStatus": "This Page is currently running ads.",
      "adLibraryPageId": "104359362513119",
      "hours": {
        "monday": {
          "open": "11:00",
          "close": "21:30",
          "intervals": [
            {
              "open": "11:00",
              "close": "14:30"
            },
            {
              "open": "16:30",
              "close": "21:30"
            }
          ],
          "text": "11:00 - 14:30, 16:30 - 21:30"
        }
      }
    }
  },
  "meta": {
    "requestId": "req_01example_business",
    "creditsCharged": 1,
    "version": "v1"
  }
}
```

### Example JSON (private)

```json
{
  "data": {
    "lookupStatus": "private",
    "profile": null,
    "metrics": null,
    "contact": null,
    "business": null
  },
  "meta": {
    "requestId": "req_01example_private",
    "creditsCharged": 1,
    "version": "v1"
  }
}
```

### Example JSON (not_found)

```json
{
  "data": {
    "lookupStatus": "not_found",
    "profile": null,
    "metrics": null,
    "contact": null,
    "business": null
  },
  "meta": {
    "requestId": "req_01example_nf",
    "creditsCharged": 1,
    "version": "v1"
  }
}
```

### Machine-readable error codes

When an error JSON body is returned, it may include one of these `error.code` values (derived from the OpenAPI schemas for this operation; additional codes may exist at runtime):

- `bad_request`

## Error handling & retries

Interpret HTTP status codes using the descriptions below. Do not assume a JSON body unless the OpenAPI schema defines one for that status.

- **400**: Invalid query or bad request **Retry:** Fix the request; retrying the same invalid payload will not help.
- **401**: Missing or invalid API key **Retry:** Fix the API key first; retrying without changes will not help.
- **402**: Insufficient credits **Retry:** Do not retry without resolving billing/credits (retrying the same request will not help).
- **500**: Unexpected or billing error
- **502**: Lookup could not be completed from the response (unexpected or invalid data). **Retry:** May be transient; a few retries with backoff are reasonable.
- **503**: Service temporarily unavailable; safe to retry with backoff. **Retry:** Usually safe to retry with exponential backoff and jitter.

### Suggested client defaults

- Send the API key using the `x-api-key` header on every request.
- On `503` (and sometimes `502`), retry with backoff; cap retries and surface a clear error to the user.
- On `402`, surface an actionable billing message rather than blind retries.

## Examples

### TypeScript SDK

```typescript
import { SocialFetchClient } from "@socialfetch/sdk";

const client = new SocialFetchClient({
  apiKey: process.env.SOCIALFETCH_API_KEY!,
});

const result = await client.facebook.getProfile({
  url: "https://www.facebook.com/profile.php?id=61575098504636",
});

if (!result.ok) {
  console.error(result.error);
} else {
  console.log(result.value.data);
}
```

### Node.js

```javascript
const response = await fetch(
  "https://api.socialfetch.dev/v1/facebook/profiles?url=https://www.facebook.com/profile.php?id=61575098504636",
  {
    headers: {
      "x-api-key": "YOUR_API_KEY",
    }
  }
);

const data = await response.json();
console.log(data);
```

### cURL

```bash
curl "https://api.socialfetch.dev/v1/facebook/profiles?url=https://www.facebook.com/profile.php?id=61575098504636" \
  -H "x-api-key: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.get(
    "https://api.socialfetch.dev/v1/facebook/profiles?url=https://www.facebook.com/profile.php?id=61575098504636",
    headers={"x-api-key": "YOUR_API_KEY"},
)
data = response.json()
print(data)
```