# Search profiles

Find public profiles through web indexing. Enrichment adds detail without replacing or reordering results. An unavailable index fails.

- Platform: [Instagram](https://docs.upscrape.com/docs/platforms/instagram)
- Capability ID: `instagram.profile.search`
- Cost: 1 credit per request
- Maximum runtime: 120 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "enrich": false,
    "limit": 10,
    "max_pages": 2,
    "query": "space agency"
  },
  "capability": "instagram.profile.search"
}'
```

## Input


| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enrich` | `boolean` | No | Fetch public metadata with at most four concurrent lookups and a shared 45-second budget; enrichment_status reports each result. Default: `false`. |
| `limit` | `integer` | No | Maximum number of results to return. From 1 to 25. Default: `10`. |
| `max_pages` | `integer` | No | Maximum number of result pages to fetch. From 1 to 5. Default: `2`. |
| `page` | `integer` | No | One-based result page to fetch. At least 1. Default: `1`. |
| `query` | `string` | Yes | Search query. |

### Example input

```json
{
  "enrich": false,
  "limit": 10,
  "max_pages": 2,
  "query": "space agency"
}
```

## Response

Successful output is returned in `results[0].data`.

Raw platform output is intentionally open-ended and may evolve with the upstream source.

### Illustrative sample output

This example shows one response. Values and optional fields vary with the data available.

```json
{
  "has_more": false,
  "match_mode": "keyword_popular_creators",
  "next_page": 0,
  "pages": 2,
  "query": "space agency",
  "results": [
    {
      "matched_from": "keyword_popular_creators",
      "profile": {
        "id": "17841478186170465",
        "is_verified": false,
        "username": "money.gasm_"
      },
      "url": "https://www.instagram.com/money.gasm_/",
      "username": "money.gasm_"
    },
    {
      "matched_from": "keyword_popular_creators",
      "profile": {
        "id": "17841404542629537",
        "is_verified": false,
        "username": "aiwowai"
      },
      "url": "https://www.instagram.com/aiwowai/",
      "username": "aiwowai"
    },
    {
      "matched_from": "keyword_popular_creators",
      "profile": {
        "id": "17841472934915750",
        "is_verified": false,
        "username": "astrostrory"
      },
      "url": "https://www.instagram.com/astrostrory/",
      "username": "astrostrory"
    }
  ],
  "total_count": 10
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `has_more` | `boolean` | false |
| `match_mode` | `string` | keyword_popular_creators |
| `next_page` | `integer` | 0 |
| `pages` | `integer` | 2 |
| `query` | `string` | space agency |
| `results` | `array` | 3 items |
| `results` | `array` | 3 items |
| `total_count` | `integer` | 10 |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
