{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram DM & Engagement API - Like, Follow, Comment",
    "description": "Send Instagram DMs, like posts, follow users, post comments, and scrape profiles via REST API. Multi-account sessions with proxy routing. 43 endpoints, pay-per-use. No browser, no Selenium.",
    "version": "0.0",
    "x-build-id": "VDrqsBVyVhrmVbTZ1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zen-studio~instagram-automation-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zen-studio-instagram-automation-api",
        "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/zen-studio~instagram-automation-api/runs": {
      "post": {
        "operationId": "runs-sync-zen-studio-instagram-automation-api",
        "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/zen-studio~instagram-automation-api/run-sync": {
      "post": {
        "operationId": "run-sync-zen-studio-instagram-automation-api",
        "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": {
          "action": {
            "title": "Action",
            "enum": [
              "login",
              "verify-2fa",
              "session-status",
              "send-dm",
              "user-info",
              "user-info-by-id",
              "followers",
              "following",
              "posts",
              "comments",
              "comment-replies",
              "stories",
              "stories-tray",
              "highlights",
              "highlight-items",
              "search",
              "media-info",
              "inbox",
              "thread",
              "like",
              "unlike",
              "save",
              "unsave",
              "follow",
              "unfollow",
              "remove-follower",
              "block",
              "unblock",
              "restrict",
              "unrestrict",
              "comment",
              "comment-like",
              "comment-unlike",
              "comment-delete",
              "story-like",
              "story-unlike",
              "send-message",
              "react",
              "unreact",
              "unsend",
              "mark-read",
              "typing",
              "delete-thread"
            ],
            "type": "string",
            "description": "Which action to execute. Each action requires different parameters — see fields below."
          },
          "email": {
            "title": "Account Email",
            "type": "string",
            "description": "Email of the Instagram account to use. Must be logged in first via the <code>login</code> action."
          },
          "password": {
            "title": "Password",
            "type": "string",
            "description": "Only needed for the <code>login</code> action."
          },
          "code": {
            "title": "2FA Code",
            "type": "string",
            "description": "6-digit verification code. Only needed for the <code>verify-2fa</code> action."
          },
          "country": {
            "title": "Proxy Country",
            "type": "string",
            "description": "ISO country code for residential proxy routing. Set at login, sticks with the session.<br><br>Match the account's normal login location to avoid challenges.",
            "default": "US"
          },
          "user": {
            "title": "User",
            "type": "string",
            "description": "Instagram username, profile URL, or numeric ID. Accepts any format: <code>zuck</code>, <code>https://instagram.com/zuck</code>, or <code>314216</code>. Used by most endpoints."
          },
          "media_id": {
            "title": "Media ID",
            "type": "string",
            "description": "Post/reel ID, shortcode, or full URL. Used by: <code>like</code>, <code>unlike</code>, <code>save</code>, <code>comments</code>, <code>media-info</code>, <code>comment</code>."
          },
          "query": {
            "title": "Search Query",
            "type": "string",
            "description": "Search term. Used by: <code>search</code>."
          },
          "text": {
            "title": "Text",
            "type": "string",
            "description": "Message or comment text. Used by: <code>send-dm</code>, <code>send-message</code>, <code>comment</code>."
          },
          "limit": {
            "title": "Limit",
            "type": "integer",
            "description": "Max results to return. Used by paginated endpoints: <code>followers</code>, <code>following</code>, <code>posts</code>, <code>comments</code>, <code>inbox</code>, <code>thread</code>."
          },
          "cursor": {
            "title": "Cursor",
            "type": "string",
            "description": "Pagination cursor from a previous response's <code>next_cursor</code>. Used by paginated endpoints: <code>followers</code>, <code>following</code>, <code>posts</code>, <code>comments</code>, <code>inbox</code>, <code>thread</code>."
          },
          "thread_id": {
            "title": "Thread ID",
            "type": "string",
            "description": "DM thread ID (short numeric format). Used by: <code>send-message</code>, <code>thread</code>, <code>react</code>, <code>mark-read</code>, <code>typing</code>, <code>delete-thread</code>."
          },
          "message_id": {
            "title": "Message ID",
            "type": "string",
            "description": "DM message ID. Used by: <code>react</code>, <code>unreact</code>, <code>unsend</code>."
          },
          "timestamp_ms": {
            "title": "Timestamp (ms)",
            "type": "integer",
            "description": "Message timestamp in milliseconds. Required for <code>react</code> and <code>unreact</code>."
          },
          "emoji": {
            "title": "Emoji",
            "type": "string",
            "description": "Reaction emoji for <code>react</code>. Defaults to ❤️.",
            "default": "❤️"
          },
          "typing": {
            "title": "Typing",
            "type": "boolean",
            "description": "Typing indicator state for <code>typing</code> action. true = start typing, false = stop.",
            "default": true
          },
          "comment_id": {
            "title": "Comment ID",
            "type": "string",
            "description": "Instagram comment ID. Used by: <code>comment-like</code>, <code>comment-unlike</code>, <code>comment-delete</code>, <code>comment-replies</code>."
          },
          "reply_to": {
            "title": "Reply To Comment ID",
            "type": "string",
            "description": "Comment ID to reply to. Only used by <code>comment</code> action for threaded replies."
          },
          "story_id": {
            "title": "Story ID",
            "type": "string",
            "description": "Instagram story ID. Used by: <code>story-like</code>, <code>story-unlike</code>."
          },
          "highlight_ids": {
            "title": "Highlight IDs",
            "type": "array",
            "description": "List of highlight IDs. Used by: <code>highlight-items</code>.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}