{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram API Scraper By Likes, Keywords & Date Range",
    "description": null,
    "version": "0.1",
    "x-build-id": "GuAhse22d0SUDiUqF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraply~instagram-api-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraply-instagram-api-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/scraply~instagram-api-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraply-instagram-api-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/scraply~instagram-api-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraply-instagram-api-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": {
          "filterTargets": {
            "title": "🎯 Profiles to filter",
            "type": "array",
            "description": "Instagram profile URLs or bare usernames whose feed should be scanned and filtered.\n• `https://www.instagram.com/humansofny/`\n• `humansofny`\n\nSingle post, reel and hashtag URLs are still accepted, but Instagram login-walls those surfaces for logged-out clients — they produce an uncharged audit row carrying a typed `errorReason` instead of results.",
            "items": {
              "type": "string"
            }
          },
          "contentMode": {
            "title": "🗂️ Feed to scan",
            "enum": [
              "posts",
              "reels",
              "mentions"
            ],
            "type": "string",
            "description": "Which feed of each profile the filters run over.\n• 📷 **Timeline posts** — the main grid (photos, videos and carousels)\n• 🎬 **Reels feed** — the clips feed only\n• 🔖 **Mentions found in posts** — one row per `@mention` inside the matching posts",
            "default": "posts"
          },
          "keepPerTarget": {
            "title": "🔢 Matching items to keep per profile",
            "minimum": 1,
            "maximum": 2400,
            "type": "integer",
            "description": "Stop once this many items have PASSED the filters for a profile — rejected posts do not count towards it. Example: keepPerTarget=10 with ❤️ minLikes=50000 keeps paging until 10 posts clear 50,000 likes, or the scan budget below runs out. Default 10.",
            "default": 10
          },
          "scanBudget": {
            "title": "📄 Max posts to scan per profile",
            "minimum": 0,
            "maximum": 2400,
            "type": "integer",
            "description": "Safety cap on how many posts are examined per profile before the search gives up. Strict filters could otherwise page an entire account. Example: minLikes=1000000 + scanBudget=120 examines at most 120 posts and then reports `scanBudgetReached: true` in the audit row. 0 = no cap (engine ceiling is ~2,400 posts). Default 120.",
            "default": 120
          },
          "minLikes": {
            "title": "❤️ Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only posts with at least this many likes. `like_count` was present on 100% of scanned logged-out feed items. Posts whose owner hides like counts are rejected with reason `likes_hidden` — never silently read as 0. Default 0 (off).",
            "default": 0
          },
          "minComments": {
            "title": "💬 Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only posts with at least this many comments. `comment_count` was present on 100% of scanned logged-out feed items. Default 0 (off).",
            "default": 0
          },
          "minViews": {
            "title": "👁️ Minimum views (video only)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only videos and reels with at least this many plays. Photos and carousels carry no view metric at all logged-out, so they are rejected with reason `no_view_metric` rather than counted as 0. Default 0 (off).",
            "default": 0
          },
          "captionKeywords": {
            "title": "🔤 Caption must contain",
            "type": "array",
            "description": "Case-insensitive substrings the caption must contain. Hashtags work too — `#giveaway` and `sale` are both valid entries. Every term that fired is reported back in the `matchedKeywords` column. Leave empty to skip.",
            "items": {
              "type": "string"
            }
          },
          "keywordMatchMode": {
            "title": "🔗 How to combine the keywords",
            "enum": [
              "any",
              "all"
            ],
            "type": "string",
            "description": "• **Any** — keep the post if at least one term appears (OR)\n• **All** — keep it only if every term appears (AND)",
            "default": "any"
          },
          "captionKeywordsExclude": {
            "title": "🚫 Caption must NOT contain",
            "type": "array",
            "description": "Case-insensitive substrings that disqualify a post — useful for stripping giveaways, reposts or ad tags (`giveaway`, `#ad`, `link in bio`). Rejections show up in the audit row as `excluded_keyword`.",
            "items": {
              "type": "string"
            }
          },
          "postedAfter": {
            "title": "📆 Posted after",
            "type": "string",
            "description": "Lower edge of the date window. Absolute (`2026-01-31`) or relative (`7 days`, `2 months`, `1 year`). Because Instagram serves the feed newest-first, this also stops paging once older posts appear. All times UTC. Same meaning as the base actor's `onlyPostsNewerThan`."
          },
          "postedBefore": {
            "title": "📆 Posted before",
            "type": "string",
            "description": "Upper edge of the window — anything newer is skipped with reason `newer_than_window` while paging continues backwards. Absolute (`2026-06-30`) or relative (`30 days` = exclude the last 30 days). Combine with 📆 Posted after to isolate a single month, quarter or campaign."
          },
          "mediaTypeFilter": {
            "title": "🖼️ Keep which media types",
            "enum": [
              "any",
              "photo",
              "video",
              "reel",
              "carousel"
            ],
            "type": "string",
            "description": "Derived from the payload's `product_type` / `media_type`, present on 100% of scanned items.\n• 🖼️ **Photos** — single-image posts\n• 🎞️ **Videos & reels** — anything with a video track\n• 🎬 **Reels only** — clips-product posts\n• 🎠 **Carousels** — multi-item posts",
            "default": "any"
          },
          "includeFilterAudit": {
            "title": "🧾 Add an uncharged filter audit row per profile",
            "type": "boolean",
            "description": "Pushes one extra, never-billed row per profile: how many posts were scanned, how many were kept, and a count for every rejection reason — so a 120-scanned / 4-kept run is auditable instead of looking broken. It also carries a typed `errorReason` when a target yields nothing (private account, login-walled surface, fetch failure). Default on.",
            "default": true
          },
          "attachSourceMetadata": {
            "title": "🧷 Attach source profile metadata",
            "type": "boolean",
            "description": "Adds a `parentData` object (source profile name / type / URL) to every result row. Same meaning as the base actor's `addParentData`.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy configuration",
            "type": "object",
            "description": "🌐 Default: **no proxy** — this actor talks to Instagram's public feed API directly, which is the fastest and cheapest path and is the configuration it was verified on. If Instagram pushes back the run auto-escalates to an Apify proxy and then to sticky residential. Override only to force a tier.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}