{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Post Scraper ✨",
    "description": "Returns post data including post URLs, shortcodes, media IDs,  comments, replies, reply status, captions, timestamps, likes and comment counts, carousel media, author info, tags, locations and request feedback with requested versus returned data ✨Instagram Post Scraper👤",
    "version": "1.0",
    "x-build-id": "pCOilBTWCJI6HxfcG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/premiumscraper~instagram-post-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-premiumscraper-instagram-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/premiumscraper~instagram-post-scraper/runs": {
      "post": {
        "operationId": "runs-sync-premiumscraper-instagram-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/premiumscraper~instagram-post-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-premiumscraper-instagram-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": {
          "username": {
            "title": "👤 Instagram Username(s)",
            "type": "array",
            "description": "Enter one or more Instagram usernames such as nba, natgeo, or cristiano. Each username is automatically converted into a profile URL.",
            "items": {
              "type": "string"
            }
          },
          "instagram_urls": {
            "title": "🔗 Instagram Profile, Direct Post URLs",
            "type": "array",
            "description": "Add one or more Instagram profile or direct post URLs. Supported formats:\n• Username: nba\n• Profile URL: https://www.instagram.com/nba/\n• Direct post URL: https://www.instagram.com/p/DYTjzALNBaZ/\n• Direct reel URL: https://www.instagram.com/reel/DYTjzALNBaZ/\n\nProfile inputs use timeline GraphQL data only. Direct post and reel URLs are scraped from the public post page.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "posts_count": {
            "title": "📰 Posts Per Profile",
            "minimum": 1,
            "type": "integer",
            "description": "How many timeline posts to return for each profile input. This setting applies only to profile scraping, not direct post URLs. If fewer public posts are available, the output says how many were requested and how many were returned.",
            "default": 10
          },
          "proxyCountry": {
            "title": "🌐 Proxy Country",
            "enum": [
              "US",
              "GB",
              "AU",
              "CA",
              "DE",
              "FR",
              "NL",
              "IT",
              "ES",
              "SE",
              "NO",
              "DK",
              "FI",
              "BE",
              "AT",
              "CH",
              "IE",
              "PL",
              "PT",
              "CZ",
              "HU",
              "RO",
              "GR",
              "JP",
              "KR",
              "SG",
              "IN",
              "BR",
              "MX",
              "AR",
              "TR"
            ],
            "type": "string",
            "description": "Choose the residential proxy exit country for public Instagram requests. US is recommended for the broadest public coverage.",
            "default": "US"
          },
          "skip_pinned_posts": {
            "title": "📌 Skip Pinned Posts",
            "type": "boolean",
            "description": "Turn on to skip pinned timeline posts completely. Skipped pinned posts are not counted toward Posts Per Profile. This applies only to profile timeline scraping.",
            "default": false
          },
          "posts_newer_than": {
            "title": "📅 Extract Posts That Are Newer Than",
            "type": "string",
            "description": "Only keep profile timeline posts created on or after this date. Leave empty for no lower date limit. If fewer public posts match this filter, the output clearly shows the requested and returned totals."
          },
          "include_comments": {
            "title": "💬 Include Comments",
            "type": "boolean",
            "description": "Turn on to collect public comments for each returned post. Comments are placed under comment_details together with request feedback that explains requested and returned totals. Billing is per returned comment.",
            "default": false
          },
          "comments_limit": {
            "title": "💬 Comments Limit Per Post",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of comments to return per post when comment collection is enabled. If fewer public comments are available, the output clearly shows the requested and returned totals.",
            "default": 20
          },
          "include_comment_replies": {
            "title": "↪️ Include Comment Replies",
            "type": "boolean",
            "description": "Turn on to check each returned comment for public replies. Replies are placed under all_replies inside their parent comment, and deeper public reply threads are followed when publicly available. Most Instagram comments do not have replies, so many checked comments will be marked with reply_status = no_public_replies and a reply_request note that clearly says the comment has no public replies. This setting checks only the returned comments; it does not keep scanning extra comments just to hunt for reply-bearing comments. Billing is per returned reply.",
            "default": false
          },
          "comment_replies_limit": {
            "title": "↪️ Replies Limit Per Comment",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of direct replies to collect for each collected comment or nested reply parent when reply collection is enabled. If a checked comment has no public replies, the output clearly says this comment has no replies. If fewer public replies are available than requested, the output and logs clearly show the requested amount and the returned amount. If more replies are still available after the limit is reached, the output says that too.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}