# Instagram User Posts Scraper (`powerai/instagram-user-posts-scraper`) Actor

Extract Instagram user posts with detailed media metadata, supporting automatic pagination and custom max results.

- **URL**: https://apify.com/powerai/instagram-user-posts-scraper.md
- **Developed by:** [PowerAI](https://apify.com/powerai) (community)
- **Categories:** Social media, Videos
- **Stats:** 54 total users, 1 monthly users, 90.9% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## 📸 Instagram User Posts Scraper

This actor allows you to fetch posts from a specific Instagram user by their user ID. It supports automatic pagination and lets you specify the maximum number of posts to retrieve.

### Features

- Fetches posts for any public Instagram user by user ID.
- Supports automatic pagination to collect up to your specified `maxResults`.
- Returns detailed media metadata, including images, videos, and captions.
- Handles API rate limits and errors gracefully.

### Input Parameters

| Field      | Type    | Required | Description                                      |
|------------|---------|----------|--------------------------------------------------|
| id         | integer | Yes      | Instagram user ID to fetch posts for.            |
| maxResults | integer | No       | Maximum number of posts to fetch (default: 12).  |

### Output

The output is an array of Instagram media objects, each containing:

- `id`: Media ID
- `__typename`: Media type
- `display_url`: Main media URL
- `display_resources`: Array of resource objects (src, width, height)
- `is_video`: Boolean indicating if the media is a video
- `media_preview`: Preview string or null
- `tracking_token`: Tracking token
- `has_upcoming_event`: Boolean
- `accessibility_caption`: Accessibility caption or null

### Example Input

```json
{
  "id": 18527,
  "maxResults": 12
}
````

### Example Output

```json
[
  {
    "__typename": "GraphSidecar",
    "id": "3643164212857365960",
    "gating_info": null,
    "fact_check_overall_rating": null,
    "fact_check_information": null,
    "media_overlay_info": null,
    "sensitivity_friction_info": null,
    "sharing_friction_info": {
      "should_have_sharing_friction": false,
      "bloks_app_url": null
    },
    "dimensions": {
      "height": 1346,
      "width": 1080
    },
    "display_url": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=dst-jpg_e35_p1080x1080_sh0.08_tt6&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&ig_cache_key=MzY0MzE2NDIwNTM4MzAyOTUzOQ%3D%3D.3-ccb7-5&oh=00_AfIMXCsst67nfPzH14tsvZ6R0CjlWqmQTdWMRX0xM66AiA&oe=683F45EB&_nc_sid=bc0c2c",
    "display_resources": [
      {
        "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=dst-jpg_e35_p640x640_sh0.08_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfKbzD4EltmYhjOltlss5A8fuJPL9NGIcfLllWVahwsY1w&oe=683F45EB&_nc_sid=bc0c2c",
        "config_width": 640,
        "config_height": 797
      },
      {
        "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=dst-jpg_e35_p750x750_sh0.08_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfKnvTtnE_d5DsDv4B5XRQoix-kzAfnki0AUZt-57abluQ&oe=683F45EB&_nc_sid=bc0c2c",
        "config_width": 750,
        "config_height": 934
      },
      {
        "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=dst-jpg_e35_p1080x1080_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfKKKQTVd1287Tm1mJXh1jV_xu6Hesh6gbIimDm-g6Ancg&oe=683F45EB&_nc_sid=bc0c2c",
        "config_width": 1080,
        "config_height": 1346
      }
    ],
    "is_video": false,
    "media_preview": null,
    "tracking_token": "eyJ2ZXJzaW9uIjo1LCJwYXlsb2FkIjp7ImlzX2FuYWx5dGljc190cmFja2VkIjp0cnVlLCJ1dWlkIjoiMzIyNDc0MzE4MmJlNDI2YjkyODU5ZDIxODYyNzc2YmYzNjQzMTY0MjEyODU3MzY1OTYwIn0sInNpZ25hdHVyZSI6IiJ9",
    "has_upcoming_event": false,
    "edge_media_to_tagged_user": {
      "edges": [
        {
          "node": {
            "user": {
              "full_name": "BBQ Box 串烧工坊",
              "followed_by_viewer": false,
              "id": "8635134347",
              "is_verified": true,
              "profile_pic_url": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-19/430678779_362739459969196_7668945801601983914_n.jpg?stp=dst-jpg_e0_s150x150_tt6&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=-ZOtZ5oiO74Q7kNvwEolDBm&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfKpEzmfdJw6pSEwb7hLCV2TSynUQxqU43HnxUbWM6ANSA&oe=683F152F&_nc_sid=bc0c2c",
              "username": "bbqboxsg"
            },
            "x": 0.7581395349000001,
            "y": 0.4364340967
          }
        }
      ]
    },
    "accessibility_caption": null,
    "edge_media_to_caption": {
      "edges": [
        {
          "node": {
            "text": "Rain-soaked streets and neon lights. A little rain never stopped the vibe. Chinatown is always alive with energy, no matter the weather. \n\n*scroll & hold to see full image*\n\n#chinatownsingapore #singapore #rainynight #thisissg #cityvibes #nightphotography #citybynight #streetsofsingapore #streetsatnight #raw_nightshots #urbanaisle #urbanromantix"
          }
        }
      ]
    },
    "shortcode": "DKPHoydx2XI",
    "edge_media_to_comment": {
      "count": 33,
      "page_info": {
        "has_next_page": true,
        "end_cursor": ""
      }
    },
    "edge_media_to_sponsor_user": {
      "edges": []
    },
    "is_affiliate": false,
    "is_paid_partnership": false,
    "comments_disabled": false,
    "taken_at_timestamp": 1748519039,
    "edge_media_preview_like": {
      "count": -1,
      "edges": [
        {
          "node": {
            "id": "211233695",
            "profile_pic_url": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-19/293331782_3174356176214934_4741901950907590589_n.jpg?stp=dst-jpg_e0_s150x150_tt6&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=106&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=VE0OTROIcWoQ7kNvwEekcM1&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfJRUeQDXH3BTjOvN8hjxT2_CTZASeFpwri1Kw4CC0ghGg&oe=683F31C2&_nc_sid=bc0c2c",
            "username": "tommy_marino1"
          }
        },
        {
          "node": {
            "id": "656057783",
            "profile_pic_url": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-19/152463519_2864709513788085_842425852358698073_n.jpg?stp=dst-jpg_e0_s150x150_tt6&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=1&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=bhHieN3R210Q7kNvwFaairU&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfKPsy_54NfeKPhWVTxI0AeYr1HZVIdC7RVHkGBUYfkKMQ&oe=683F13BA&_nc_sid=bc0c2c",
            "username": "nyclovesnyc"
          }
        }
      ]
    },
    "owner": {
      "id": "18527",
      "username": "javan"
    },
    "location": {
      "id": "108696550922980",
      "has_public_page": true,
      "name": "Singapore 新加坡",
      "slug": "singapore"
    },
    "nft_asset_info": null,
    "viewer_has_liked": false,
    "viewer_has_saved": false,
    "viewer_has_saved_to_collection": false,
    "viewer_in_photo_of_you": false,
    "viewer_can_reshare": true,
    "thumbnail_src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=c0.177.1440.1440a_dst-jpg_e35_s640x640_sh0.08_tt6&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&ig_cache_key=MzY0MzE2NDIwNTM4MzAyOTUzOQ%3D%3D.3.c-ccb7-5&oh=00_AfJ7Doqwh6Yy9bKVfE4QmVVtrBZvdXAoILxusfBgj_p6tw&oe=683F45EB&_nc_sid=bc0c2c",
    "thumbnail_resources": [
      {
        "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=c0.177.1440.1440a_dst-jpg_e35_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfLoW6UsqFqRORatqi8rinEAdHDpKsNdctVGoJ9p9rKMpQ&oe=683F45EB&_nc_sid=bc0c2c",
        "config_width": 150,
        "config_height": 150
      },
      {
        "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=c0.177.1440.1440a_dst-jpg_e35_s240x240_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfIo5xuIOYHVmP01tmdWH2qcIYAs6dcw2rBrwJVFDl01Aw&oe=683F45EB&_nc_sid=bc0c2c",
        "config_width": 240,
        "config_height": 240
      },
      {
        "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=c0.177.1440.1440a_dst-jpg_e35_s320x320_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfLdX9hapMbvdJ-e_BuuIzndfFAzGKPwCpDNGSVWCWitgg&oe=683F45EB&_nc_sid=bc0c2c",
        "config_width": 320,
        "config_height": 320
      },
      {
        "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=c0.177.1440.1440a_dst-jpg_e35_s480x480_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfJ471xoeR-gGEQC3FwsMpQA02VZa7KuR6TzM7DKBKuIgQ&oe=683F45EB&_nc_sid=bc0c2c",
        "config_width": 480,
        "config_height": 480
      },
      {
        "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=c0.177.1440.1440a_dst-jpg_e35_s640x640_sh0.08_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfJ7Doqwh6Yy9bKVfE4QmVVtrBZvdXAoILxusfBgj_p6tw&oe=683F45EB&_nc_sid=bc0c2c",
        "config_width": 640,
        "config_height": 640
      }
    ],
    "coauthor_producers": [],
    "pinned_for_users": [],
    "like_and_view_counts_disabled": true,
    "edge_sidecar_to_children": {
      "edges": [
        {
          "node": {
            "__typename": "GraphImage",
            "id": "3643164205383029539",
            "gating_info": null,
            "fact_check_overall_rating": null,
            "fact_check_information": null,
            "media_overlay_info": null,
            "sensitivity_friction_info": null,
            "sharing_friction_info": {
              "should_have_sharing_friction": false,
              "bloks_app_url": null
            },
            "dimensions": {
              "height": 1346,
              "width": 1080
            },
            "display_url": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=dst-jpg_e35_p1080x1080_sh0.08_tt6&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&ig_cache_key=MzY0MzE2NDIwNTM4MzAyOTUzOQ%3D%3D.3-ccb7-5&oh=00_AfIMXCsst67nfPzH14tsvZ6R0CjlWqmQTdWMRX0xM66AiA&oe=683F45EB&_nc_sid=bc0c2c",
            "display_resources": [
              {
                "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=dst-jpg_e35_p640x640_sh0.08_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfKbzD4EltmYhjOltlss5A8fuJPL9NGIcfLllWVahwsY1w&oe=683F45EB&_nc_sid=bc0c2c",
                "config_width": 640,
                "config_height": 797
              },
              {
                "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=dst-jpg_e35_p750x750_sh0.08_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfKnvTtnE_d5DsDv4B5XRQoix-kzAfnki0AUZt-57abluQ&oe=683F45EB&_nc_sid=bc0c2c",
                "config_width": 750,
                "config_height": 934
              },
              {
                "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501657423_18501285874018528_5909921503236186447_n.jpg?stp=dst-jpg_e35_p1080x1080_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=ti7h8L3PZAYQ7kNvwFs1p7g&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfKKKQTVd1287Tm1mJXh1jV_xu6Hesh6gbIimDm-g6Ancg&oe=683F45EB&_nc_sid=bc0c2c",
                "config_width": 1080,
                "config_height": 1346
              }
            ],
            "is_video": false,
            "media_preview": "ACIqxAxxjtTgtRbM9xUqDaKTLRFtG7BpqqCeamjILgkbh3HTt7VYDbj84OMduORwO3p2/GobsWo3KBHNFa2yL/nmf1/xopc6/qw/Zsq2yK2SRn68iknRAcjjkcdqbblgDj+dMkJOd3HP17VfUz6eZPboPvbgp56jP+c1Y3YcLnqPQfzPHvVFAce31FTSKSwGOo9etQ0m9TRNpaX/ABLmff8A8fX/AAoqr9mb+7+ooosuy/AfNL+Z/iV4G2HkcUkrFmyBxTEpTVW1uc9tbk8BZsIBzV5kc7cDkD096owdfwq3k1hPc76a900sj0orKJoqNe/4F8qP/9k=",
            "tracking_token": "eyJ2ZXJzaW9uIjo1LCJwYXlsb2FkIjp7ImlzX2FuYWx5dGljc190cmFja2VkIjp0cnVlLCJ1dWlkIjoiMzIyNDc0MzE4MmJlNDI2YjkyODU5ZDIxODYyNzc2YmYzNjQzMTY0MjA1MzgzMDI5NTM5In0sInNpZ25hdHVyZSI6IiJ9",
            "has_upcoming_event": false,
            "edge_media_to_tagged_user": {
              "edges": [
                {
                  "node": {
                    "user": {
                      "full_name": "BBQ Box 串烧工坊",
                      "followed_by_viewer": false,
                      "id": "8635134347",
                      "is_verified": true,
                      "profile_pic_url": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-19/430678779_362739459969196_7668945801601983914_n.jpg?stp=dst-jpg_e0_s150x150_tt6&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=-ZOtZ5oiO74Q7kNvwEolDBm&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfKpEzmfdJw6pSEwb7hLCV2TSynUQxqU43HnxUbWM6ANSA&oe=683F152F&_nc_sid=bc0c2c",
                      "username": "bbqboxsg"
                    },
                    "x": 0.7581395349000001,
                    "y": 0.4364340967
                  }
                }
              ]
            },
            "accessibility_caption": null
          }
        },
        {
          "node": {
            "__typename": "GraphImage",
            "id": "3643164205341147123",
            "gating_info": null,
            "fact_check_overall_rating": null,
            "fact_check_information": null,
            "media_overlay_info": null,
            "sensitivity_friction_info": null,
            "sharing_friction_info": {
              "should_have_sharing_friction": false,
              "bloks_app_url": null
            },
            "dimensions": {
              "height": 1346,
              "width": 1080
            },
            "display_url": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501331505_18501285883018528_338344890616338567_n.jpg?stp=dst-jpg_e35_p1080x1080_sh0.08_tt6&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=qzxRGhtQifMQ7kNvwEaF65h&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&ig_cache_key=MzY0MzE2NDIwNTM0MTE0NzEyMw%3D%3D.3-ccb7-5&oh=00_AfLBrlmSM9yCt9AGHOKCMAzzgVdJusrdz5HDUB4YlTkIXw&oe=683F15CB&_nc_sid=bc0c2c",
            "display_resources": [
              {
                "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501331505_18501285883018528_338344890616338567_n.jpg?stp=dst-jpg_e35_p640x640_sh0.08_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=qzxRGhtQifMQ7kNvwEaF65h&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfIdraXnKEmAltaj8FKiBcTjtG_vt4qgIVmWs9FoxYBlAw&oe=683F15CB&_nc_sid=bc0c2c",
                "config_width": 640,
                "config_height": 797
              },
              {
                "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501331505_18501285883018528_338344890616338567_n.jpg?stp=dst-jpg_e35_p750x750_sh0.08_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=qzxRGhtQifMQ7kNvwEaF65h&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfL2QFxIpIBv_08H4K_uBkvMJCCQjmj4KBQ_bb3afI2dUw&oe=683F15CB&_nc_sid=bc0c2c",
                "config_width": 750,
                "config_height": 934
              },
              {
                "src": "https://instagram.fqpa2-1.fna.fbcdn.net/v/t51.2885-15/501331505_18501285883018528_338344890616338567_n.jpg?stp=dst-jpg_e35_p1080x1080_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTUuc2RyLmY3NTc2MS5kZWZhdWx0X2ltYWdlIn0&_nc_ad=z-m&_nc_ht=instagram.fqpa2-1.fna.fbcdn.net&_nc_cat=104&_nc_oc=Q6cZ2QFS9DXpdcHuGyDOc2ik1FDkF9UhjEinB_awal3fdrQKqO-9xS-qI11ibdhsScYDGy8&_nc_ohc=qzxRGhtQifMQ7kNvwEaF65h&_nc_gid=pWkeD2tTAhCe_JL8AjHF5g&edm=APU89FABAAAA&ccb=7-5&oh=00_AfKGM6aX3BcFFpqLCTdbIZLVz-VoLns9aDZtViyxB9r9_w&oe=683F15CB&_nc_sid=bc0c2c",
                "config_width": 1080,
                "config_height": 1346
              }
            ],
            "is_video": false,
            "media_preview": "ACIqx4omxvHbBqT7RMPTj2X/AA9qtxSoAY+5wAO/fioHVVJyGAHX29KSZo0VZXaUl2xn2AH8qjSVo8hejdehz+dSuyEEKaieNkxuBGRkZ7j1pkCeYaKZiii7FYsliHJXqDx+B4qU3DyAhjwev4VW6E0hX0qLJmt2IRzU4CyKMk7hnPfjtVfipkQkZAz1702SM8setFP59BRRqGhK4bzDkYGfSnS7fmC56jHH501qQ9KUVezNJaNorfNnp+laEjBEUDBPJOPccfrVOlq2jJOwzLe9FOooEf/Z",
            "tracking_token": "eyJ2ZXJzaW9uIjo1LCJwYXlsb2FkIjp7ImlzX2FuYWx5dGljc190cmFja2VkIjp0cnVlLCJ1dWlkIjoiMzIyNDc0MzE4MmJlNDI2YjkyODU5ZDIxODYyNzc2YmYzNjQzMTY0MjA1MzQxMTQ3MTIzIn0sInNpZ25hdHVyZSI6IiJ9",
            "has_upcoming_event": false,
            "edge_media_to_tagged_user": {
              "edges": []
            },
            "accessibility_caption": null
          }
        }
      ]
    },
    "scrapedAt": "2025-05-30T07:17:43.493Z"
  },
  ...
]
```

### Notes

- The actor requires a valid Instagram user ID.
- Only public posts are accessible.

# Actor input Schema

## `id` (type: `string`):

Instagram user ID to fetch posts for.

## `maxResults` (type: `integer`):

Maximum number of posts to fetch.

## Actor input object example

```json
{
  "id": "18527",
  "maxResults": 12
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "id": "18527"
};

// Run the Actor and wait for it to finish
const run = await client.actor("powerai/instagram-user-posts-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "id": "18527" }

# Run the Actor and wait for it to finish
run = client.actor("powerai/instagram-user-posts-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "id": "18527"
}' |
apify call powerai/instagram-user-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=powerai/instagram-user-posts-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram User Posts Scraper",
        "description": "Extract Instagram user posts with detailed media metadata, supporting automatic pagination and custom max results.",
        "version": "0.0",
        "x-build-id": "yqcO1xEgFYx4jGQak"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/powerai~instagram-user-posts-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-powerai-instagram-user-posts-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/powerai~instagram-user-posts-scraper/runs": {
            "post": {
                "operationId": "runs-sync-powerai-instagram-user-posts-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/powerai~instagram-user-posts-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-powerai-instagram-user-posts-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "id"
                ],
                "properties": {
                    "id": {
                        "title": "User ID",
                        "type": "string",
                        "description": "Instagram user ID to fetch posts for.",
                        "default": "18527"
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 12,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of posts to fetch.",
                        "default": 12
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
