{
  "openapi": "3.0.1",
  "info": {
    "title": "Zalo Data Scraper",
    "description": "Export your Zalo account's friends, groups, group members and chat history to JSON, CSV or Excel. Log in once by scanning a QR code with the Zalo app; the session is saved, so later runs need no scan.",
    "version": "0.0",
    "x-build-id": "REJoeg86aFVyTpO9L"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dead00~zalo-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dead00-zalo-data-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/dead00~zalo-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-dead00-zalo-data-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/dead00~zalo-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-dead00-zalo-data-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": {
          "lookupUserIds": {
            "title": "Look up people by Zalo user ID",
            "type": "array",
            "description": "Zalo user IDs (long numbers) to fetch profile info for: name, avatar, and whatever their privacy settings allow. Get IDs from the friends or group-members output.",
            "items": {
              "type": "string"
            }
          },
          "lookupGroupIds": {
            "title": "Look up groups by group ID",
            "type": "array",
            "description": "Zalo group IDs to fetch info for: name, members, admins. Your account must be able to see the group.",
            "items": {
              "type": "string"
            }
          },
          "exportFriends": {
            "title": "Export friends",
            "type": "boolean",
            "description": "Export your friends list (name, Zalo ID, avatar, and phone number only if the friend shares it).",
            "default": true
          },
          "exportGroups": {
            "title": "Export groups",
            "type": "boolean",
            "description": "Export the groups you are in, with name, description, member count and admin list.",
            "default": true
          },
          "exportGroupMembers": {
            "title": "Export group members",
            "type": "boolean",
            "description": "For each of your groups, resolve member IDs to names and avatars.",
            "default": true
          },
          "exportGroupHistory": {
            "title": "Export recent group chat history",
            "type": "boolean",
            "description": "Export recent messages from each of your groups. Off by default, since chat content is sensitive.",
            "default": false
          },
          "exportFriendHistory": {
            "title": "Export private (1:1) chat history",
            "type": "boolean",
            "description": "Recent messages from your direct chats with friends. Uses a live connection to Zalo; only recent synced history is available.",
            "default": false
          },
          "historyMessageCount": {
            "title": "Messages per group",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many recent messages to fetch per group when history export is on.",
            "default": 50
          },
          "maxFriendsForHistory": {
            "title": "Max friends for private history",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Cap how many friends' chats to pull, to keep the run bounded.",
            "default": 20
          },
          "exportAccountInfo": {
            "title": "Export account info",
            "type": "boolean",
            "description": "Your own full profile (name, bio, avatar, phone).",
            "default": true
          },
          "exportFriendAliases": {
            "title": "Export friend aliases",
            "type": "boolean",
            "description": "Nicknames you set for friends.",
            "default": false
          },
          "exportLabels": {
            "title": "Export labels",
            "type": "boolean",
            "description": "Your friend/chat labels (tags).",
            "default": false
          },
          "exportCloseFriends": {
            "title": "Export close friends",
            "type": "boolean",
            "description": "Your close-friends list.",
            "default": false
          },
          "exportSentFriendRequests": {
            "title": "Export sent friend requests",
            "type": "boolean",
            "description": "Friend requests you have sent.",
            "default": false
          },
          "exportPinnedConversations": {
            "title": "Export pinned conversations",
            "type": "boolean",
            "description": "Your pinned chats.",
            "default": false
          },
          "exportArchivedConversations": {
            "title": "Export archived conversations",
            "type": "boolean",
            "description": "Your archived chats.",
            "default": false
          },
          "exportMutedConversations": {
            "title": "Export muted conversations",
            "type": "boolean",
            "description": "Chats you have muted.",
            "default": false
          },
          "exportAutoReplies": {
            "title": "Export auto-replies",
            "type": "boolean",
            "description": "Your auto-reply rules.",
            "default": false
          },
          "exportQuickMessages": {
            "title": "Export quick messages",
            "type": "boolean",
            "description": "Your saved quick-reply messages.",
            "default": false
          },
          "exportDevices": {
            "title": "Export logged-in devices",
            "type": "boolean",
            "description": "Devices currently signed in to your account.",
            "default": false
          },
          "exportSettings": {
            "title": "Export settings",
            "type": "boolean",
            "description": "Your account settings.",
            "default": false
          },
          "exportAvatars": {
            "title": "Export avatar history",
            "type": "boolean",
            "description": "Your past profile pictures.",
            "default": false
          },
          "exportBusinessCatalogs": {
            "title": "Export business catalogs",
            "type": "boolean",
            "description": "Product catalogs (only if this is a Zalo Business account).",
            "default": false
          },
          "exportGroupPendingMembers": {
            "title": "Export group pending members",
            "type": "boolean",
            "description": "For each group, people waiting for approval to join.",
            "default": false
          },
          "exportGroupReminders": {
            "title": "Export group reminders/events",
            "type": "boolean",
            "description": "For each group, its reminders and events.",
            "default": false
          },
          "sessionStoreName": {
            "title": "Session store name",
            "type": "string",
            "description": "Named key-value store where the login session is saved and reused. Use different names to keep multiple Zalo accounts separate.",
            "default": "zalo-session"
          },
          "qrWaitSeconds": {
            "title": "QR scan wait (seconds)",
            "minimum": 30,
            "maximum": 600,
            "type": "integer",
            "description": "How long the run waits for you to scan the QR before giving up.",
            "default": 150
          },
          "language": {
            "title": "Language",
            "enum": [
              "vi",
              "en"
            ],
            "type": "string",
            "description": "Interface language sent to Zalo.",
            "default": "vi"
          },
          "maxGroups": {
            "title": "Maximum groups",
            "minimum": 0,
            "type": "integer",
            "description": "Limit how many groups to process (0 = all of them). Useful for a quick first test.",
            "default": 0
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Pause between Zalo requests. Higher is slower but less likely to trigger rate limits or a ban.",
            "default": 800
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Route Zalo traffic through a proxy. Zalo often refuses connections from Apify's foreign servers, so a Vietnamese residential proxy (RESIDENTIAL, country VN) is strongly recommended. Residential proxy usage costs extra on Apify.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}