> **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/instagram/search/reels/get](https://www.socialfetch.dev/docs/api/v1/instagram/search/reels/get)
- **Markdown (.mdx) URL:** [https://www.socialfetch.dev/docs/api/v1/instagram/search/reels/get.mdx](https://www.socialfetch.dev/docs/api/v1/instagram/search/reels/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`).

---
# Search Instagram Reels (https://www.socialfetch.dev/docs/api/v1/instagram/search/reels/get)

## Summary

Search Instagram Reels by keyword with optional date filters and page-based pagination.

**Tags:** `Instagram`

## HTTP

- **Method:** GET
- **Path:** `/v1/instagram/search/reels`
- **Base URL:** `https://api.socialfetch.dev`

## Capability summary

- **SDK mapping:** `client.instagram.searchReels({ query, datePosted?, page? })`
- **Pagination:** none

## Credits

- **Base:** 1 credit per successful lookup.
- **Maximum on success (200):** 1 credit.
- **Normalization failure (502):** 1 credit charged.
- **Authoritative field:** `meta.creditsCharged`.

## Authentication

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

## Parameters

### `query` (query)

- **Required:** yes
- **Constraints:** type `string`; minLength: 1; maxLength: 512
- **Description:** Search query text for Instagram Reels.

### `datePosted` (query)

- **Required:** no
- **Constraints:** type `string`; enum: last-hour, last-day, last-week, last-month, last-year
- **Description:** Optional filter for when matching reels were posted.

### `page` (query)

- **Required:** no
- **Constraints:** type `integer`; minimum: 1
- **Description:** 1-based results page number. Omit to request the first page. Pagination is page-based.

## Responses (status codes)

- **200**: Reels search results for the requested page.
- **400**: Invalid query parameters
- **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)

Reels search results for the requested page.

### Field outline

- **data** (required) — type `object`. Endpoint-specific response payload.
  - **query** (required) — type `string`. Search query that was evaluated for this response.
  - **reels** (required) — type `array`. Instagram Reels matching the search query for the requested page. Empty when no reels match.
    - _items:_
      - **id** (required) — type `string`; minLength: 1. Instagram media id for this reel.
      - **shortcode** (required) — type `string`; minLength: 1. Public shortcode used in the Instagram reel URL.
      - **url** (required) — type `string`; minLength: 1. Canonical public Instagram URL for this reel.
      - **caption** (required) — type `string`; nullable. Caption text when Instagram provides one.
      - **takenAt** (required) — type `integer`. When the reel was taken or posted (Unix epoch seconds).
      - **thumbnailUrl** (optional) — type `string`. Thumbnail or cover image URL when available.
      - **displayUrl** (optional) — type `string`. Primary display image URL when available.
      - **videoUrl** (optional) — type `string`. Direct video URL when a playable URL is available.
      - **videoDurationSec** (optional) — type `number`; minimum: 0. Video duration in seconds when available.
      - **hasAudio** (optional) — type `boolean`. Whether the reel includes audio.
      - **accessibilityCaption** (optional) — type `string`; nullable. Accessibility caption when Instagram provides one.
      - **metrics** (optional) — type `object`. Engagement metrics when Instagram exposes them.
        - **views** (optional) — type `integer`; minimum: 0. View count when Instagram exposes it.
        - **plays** (optional) — type `integer`; minimum: 0. Play count when Instagram exposes it.
        - **likes** (optional) — type `integer`; minimum: 0. Like count when Instagram exposes it.
        - **comments** (optional) — type `integer`; minimum: 0. Comment count when Instagram exposes it.
      - **dimensions** (optional) — type `object`. Width and height when available.
        - **width** (required) — type `integer`; minimum: 0. Media width in pixels.
        - **height** (required) — type `integer`; minimum: 0. Media height in pixels.
      - **owner** (optional) — type `object`. Reel owner metadata when Instagram exposes it.
        - **platformUserId** (optional) — type `string`. Instagram numeric user id for the reel owner when present.
        - **handle** (optional) — type `string`. Instagram username for the reel owner when present.
        - **displayName** (optional) — type `string`. Display name for the reel owner when present.
        - **avatarUrl** (optional) — type `string`. Profile image URL for the reel owner when present.
        - **verified** (optional) — type `boolean`. Whether Instagram marks the reel owner as verified.
        - **privateAccount** (optional) — type `boolean`. Whether the reel owner account is private.
        - **followerCount** (optional) — type `integer`; minimum: 0. Follower count when Instagram exposes it on the owner.
        - **postCount** (optional) — type `integer`; minimum: 0. Post count when Instagram exposes it on the owner.
      - **location** (optional) — type `object`; nullable. Tagged location when Instagram exposes it.
        - **id** (optional) — type `string`. Location id when Instagram provides one.
        - **name** (optional) — type `string`; nullable. Location name when Instagram provides one.
        - **slug** (optional) — type `string`; nullable. Location slug when Instagram provides one.
        - **addressJson** (optional) — type `string`; nullable. Serialized address metadata when Instagram provides it.
      - **audio** (optional) — type `object`; nullable. Audio attribution when Instagram exposes it.
        - **artistName** (optional) — type `string`; nullable. Attributed artist name when available.
        - **songName** (optional) — type `string`; nullable. Attributed song or audio title when available.
        - **usesOriginalAudio** (optional) — type `boolean`. Whether the reel uses original audio.
        - **shouldMuteAudio** (optional) — type `boolean`. Whether Instagram indicates the audio should be muted.
        - **shouldMuteAudioReason** (optional) — type `string`; nullable. Reason for muting audio when Instagram provides one.
        - **audioId** (optional) — type `string`; nullable. Audio track id when Instagram provides one.
      - **isAd** (optional) — type `boolean`. Whether Instagram marks the reel as an ad.
      - **isAffiliate** (optional) — type `boolean`. Whether Instagram marks the reel as affiliate content.
      - **isPaidPartnership** (optional) — type `boolean`. Whether Instagram marks the reel as a paid partnership.
  - **page** (required) — type `object`. Pagination state for the current response.
    - **currentPage** (required) — type `integer`; minimum: 1. 1-based page number for this response.
    - **nextPage** (required) — type `integer`; minimum: 1; nullable. Next page number to request when more reels are available; otherwise null.
    - **hasMore** (required) — type `boolean`. Whether another page of reels is available.
- **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 (sample)

```json
{
  "data": {
    "query": "dogs",
    "reels": [
      {
        "id": "3723045213787686915",
        "shortcode": "DOq6eV6iIgD",
        "url": "https://www.instagram.com/reel/DOq6eV6iIgD/",
        "caption": "Dogs are family",
        "takenAt": 1735626114,
        "thumbnailUrl": "https://example.com/thumb.jpg",
        "displayUrl": "https://example.com/display.jpg",
        "videoUrl": "https://example.com/video.mp4",
        "videoDurationSec": 75.7,
        "hasAudio": false,
        "metrics": {
          "views": 21808,
          "plays": 46018,
          "likes": 3487,
          "comments": 90
        },
        "owner": {
          "platformUserId": "70127159370",
          "handle": "fetchmycamera_",
          "displayName": "Mark | Dog Photographer",
          "verified": true,
          "privateAccount": false,
          "followerCount": 188406,
          "postCount": 117
        },
        "location": {
          "id": "110103980565013",
          "name": "Central Park, New York City",
          "slug": "central-park-new-york-city"
        },
        "audio": {
          "artistName": "Oliver Max",
          "songName": "Smiling Heart",
          "usesOriginalAudio": false
        },
        "isAd": false,
        "isAffiliate": false,
        "isPaidPartnership": false
      }
    ],
    "page": {
      "currentPage": 1,
      "nextPage": 2,
      "hasMore": true
    }
  },
  "meta": {
    "requestId": "req_01example_search_reels",
    "creditsCharged": 1,
    "version": "v1"
  }
}
```

### Example JSON (paginated)

```json
{
  "data": {
    "query": "dogs",
    "reels": [
      {
        "id": "3799150343414200124",
        "shortcode": "DS5SxvLgbc8",
        "url": "https://www.instagram.com/reel/DS5SxvLgbc8/",
        "caption": null,
        "takenAt": 1767101200,
        "metrics": {
          "plays": 2905,
          "likes": 268,
          "comments": 17
        }
      }
    ],
    "page": {
      "currentPage": 2,
      "nextPage": 3,
      "hasMore": true
    }
  },
  "meta": {
    "requestId": "req_01example_search_reels_page2",
    "creditsCharged": 1,
    "version": "v1"
  }
}
```

### Example JSON (sparse)

```json
{
  "data": {
    "query": "coffee",
    "reels": [
      {
        "id": "3651974801637369052",
        "shortcode": "DKua7usReTc",
        "url": "https://www.instagram.com/reel/DKua7usReTc/",
        "caption": "Local coffee shop highlight",
        "takenAt": 1749569406,
        "metrics": {
          "plays": 2905,
          "likes": 268
        },
        "owner": {
          "handle": "brandonfromvegas",
          "verified": false
        },
        "location": null,
        "audio": {
          "artistName": "brandonfromvegas",
          "songName": "Original audio",
          "usesOriginalAudio": true
        }
      }
    ],
    "page": {
      "currentPage": 1,
      "nextPage": 2,
      "hasMore": true
    }
  },
  "meta": {
    "requestId": "req_01example_search_reels_sparse",
    "creditsCharged": 1,
    "version": "v1"
  }
}
```

### Example JSON (empty)

```json
{
  "data": {
    "query": "zzzznotreal",
    "reels": [],
    "page": {
      "currentPage": 1,
      "nextPage": null,
      "hasMore": false
    }
  },
  "meta": {
    "requestId": "req_01example_search_reels_empty",
    "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 parameters **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.instagram.searchReels({
  query: "dogs",
});

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/instagram/search/reels?query=dogs",
  {
    headers: {
      "x-api-key": "YOUR_API_KEY",
    }
  }
);

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

### cURL

```bash
curl "https://api.socialfetch.dev/v1/instagram/search/reels?query=dogs" \
  -H "x-api-key: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.get(
    "https://api.socialfetch.dev/v1/instagram/search/reels?query=dogs",
    headers={"x-api-key": "YOUR_API_KEY"},
)
data = response.json()
print(data)
```