# Instagram User Posts

Retrieve an Instagram user's posts with pagination support. Returns post details including media URLs, captions, engagement metrics, and a pagination cursor for fetching more posts. A completed lookup costs one credit, including a definitive not-found result, because every lookup uses costly dedicated Instagram proxies.

- **Documentation:** [https://scrappa.co/docs/instagram-api/instagram_user_posts](https://scrappa.co/docs/instagram-api/instagram_user_posts)
- **API group:** Instagram API
- **Endpoint:** `GET https://scrappa.co/api/instagram/user/posts`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `username` | string | Yes | Instagram username (without @) |
| `max_id` | string | No | Pagination cursor from previous response (next_max_id) |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/instagram/user/posts?username=natgeo"
```

## Example response

```json
{
    "success": true,
    "found": true,
    "posts": [
        {
            "id": "3819535222330010870",
            "shortcode": "DUBtwxGEqz2",
            "media_type": "video",
            "caption": "Post caption text...",
            "hashtags": [
                "nature",
                "photography"
            ],
            "taken_at": "2024-01-15T10:30:00+00:00",
            "like_count": 125000,
            "comment_count": 3500,
            "play_count": 5000000,
            "media": [
                {
                    "type": "video",
                    "thumbnail_url": "https://...",
                    "video_url": "https://..."
                }
            ],
            "location": {
                "id": "123456",
                "name": "Los Angeles, California"
            },
            "author": {
                "username": "natgeo"
            },
            "permalink": "https://www.instagram.com/natgeo/p/DUBtwxGEqz2/"
        }
    ],
    "posts_count": 12,
    "more_available": true,
    "next_max_id": "QVFDcF..."
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 503 | Instagram Upstream Unavailable | Instagram rejected or failed all bounded attempts through approved proxies. Retry the request later. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
