{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Profile Post Scraper: Media Details & Tagged Posts",
    "description": "Instagram Profile Post Scraper extracts public profile posts, captions, media URLs, timestamps, engagement metrics, hashtags, mentions, and tagged posts. Build structured datasets for content research, influencer analysis, competitor monitoring, and social media insights.",
    "version": "0.1",
    "x-build-id": "dgcVMWDm2jA38ocJc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-empire~instagram-profile-post-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-empire-instagram-profile-post-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/api-empire~instagram-profile-post-scraper/runs": {
      "post": {
        "operationId": "runs-sync-api-empire-instagram-profile-post-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/api-empire~instagram-profile-post-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-api-empire-instagram-profile-post-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",
        "properties": {
          "profileTargets": {
            "title": "🔗 Profile URLs, Usernames, or Post Links",
            "type": "array",
            "description": "List one or more Instagram profile URLs (e.g. https://www.instagram.com/username), plain usernames (e.g. username), or post links/shortcodes. Everything is normalized into usernames automatically. Example: [\"https://www.instagram.com/cristiano/\", \"mrbeast\"].",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "🔗 Start URLs (legacy alias)",
            "type": "array",
            "description": "Legacy alias of profileTargets, accepted for backward compatibility with older input JSON. Prefer profileTargets above; leave empty if you already filled that field.",
            "items": {
              "type": "string"
            }
          },
          "postsPerProfile": {
            "title": "📦 Posts To Collect Per Profile",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "How many posts to scrape per profile. Set to 0 for unlimited posts (use with care on very large profiles). Example: postsPerProfile=50 stops each profile at 50 posts. Default 10."
          },
          "maxPosts": {
            "title": "📦 Max Posts (legacy alias)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Legacy alias of postsPerProfile, accepted for backward compatibility with older input JSON. Prefer postsPerProfile above."
          },
          "pinFilterMode": {
            "title": "📌 Pinned Post Handling",
            "enum": [
              "include",
              "skip",
              "only"
            ],
            "type": "string",
            "description": "How to treat pinned posts:\n- include: mix pinned + regular posts (default)\n- skip: exclude pinned posts\n- only: return only pinned posts, when a profile has any\nSetting skip/only always uses the accurate pin-aware engine so filtering is reliable; include also tries the faster engine first (pin state may then read null since that surface can't tell)."
          },
          "pinnedMode": {
            "title": "📌 Pinned Mode (legacy alias)",
            "enum": [
              "include",
              "skip",
              "only"
            ],
            "type": "string",
            "description": "Legacy alias of pinFilterMode, accepted for backward compatibility with older input JSON. Prefer pinFilterMode above."
          },
          "publishedWithin": {
            "title": "🗓️ Only Recent Posts",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Keep only posts newer than this. Use an absolute date (YYYY-MM-DD) or a relative value like '3 days', '2 weeks', or '1 month'. Leave empty to scrape all available posts."
          },
          "recent": {
            "title": "🗓️ Recent Filter (legacy alias)",
            "type": "string",
            "description": "Legacy alias of publishedWithin, accepted for backward compatibility with older input JSON. Prefer publishedWithin above."
          },
          "contentTypeFilter": {
            "title": "🎞️ Content Type Filter",
            "enum": [
              "all",
              "photo",
              "video",
              "carousel"
            ],
            "type": "string",
            "description": "Keep only one post type, computed locally from each post's own type/is_video/is_carousel flags. Example: contentTypeFilter=video keeps only single-video posts (reels/videos), dropping photos and carousels. Default all.",
            "default": "all"
          },
          "includeTaggedPosts": {
            "title": "🏷️ Include Tagged Posts",
            "type": "boolean",
            "description": "When on, also collects posts the profile is tagged in (Instagram's own 'Tagged' tab) and writes them to the Output table labeled type=\"taggedPost\", isChild=true, alongside a per-run child dataset mirror. Each row also carries isMentionedInCaption, a locally computed flag for whether the profile's @username appears in that tagged post's own caption. Default false.",
            "default": false
          },
          "maxTaggedPosts": {
            "title": "🔢 Max Tagged Posts Per Profile",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "How many tagged posts to collect per profile when Include Tagged Posts is on. Set to 0 to skip tagged-post collection entirely for a run. Example: maxTaggedPosts=20 + 3 profiles → up to 60 tagged-post rows. Default 20.",
            "default": 20
          },
          "requestDelay": {
            "title": "⏱️ Delay Between Requests (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Base delay between paginated requests and between profiles. Higher values are gentler but slower. Default 2.",
            "default": 2
          },
          "maxRetries": {
            "title": "🔁 Max Retries Per Request",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many times to retry a failed request (per proxy tier) before escalating or giving up. Default 3.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy Configuration",
            "type": "object",
            "description": "Configure which proxies to use for scraping. Residential proxies are strongly recommended (and usually required) for reliable Instagram scraping."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}