### Save Folder using Buster.saveFolder() Examples Source: https://hub.phantombuster.com/reference/buster-savefolder Demonstrates how to use the `buster.saveFolder()` method with Async/Await, Promises, and Callback patterns to save a folder from the agent's disk to persistent storage. Each example shows error handling and successful URL retrieval. ```JavaScript const path = "screenshots" const saveAs = "agent_screenshots" try { const url = await buster.saveFolder(path, saveAs) console.log("Folder successfully at url:", url) // The folder is permanently saved at this url you can access } catch (err) { console.log("Could not save folder:", err) } ``` ```JavaScript const path = "screenshots" const saveAs = "agent_screenshots" buster.saveFolder(path, saveAs) .then((url) => { console.log("Folder successfully at url:", url) // The folder is permanently saved at this url you can access }) .catch((err) => { console.log("Could not save folder:", err) }) ``` ```JavaScript var path = "screenshots" var saveAs = "agent_screenshots" buster.saveFolder(path, saveAs, function(err, url) { if (err) { console.log("Could not save folder:", err) } else { console.log("Folder successfully at url:", url) // The folder is permanently saved at this url you can access } }) ``` -------------------------------- ### API Endpoint: Save Lead (v2 Beta) Source: https://hub.phantombuster.com/reference/post_org-storage-leads-save Details for the PhantomBuster API v2 endpoint used to save a single lead. This is a beta feature. It specifies the HTTP method, full URL, required credentials, and notes the availability of code examples in various languages (though the examples themselves are not provided in this documentation). ```APIDOC API Endpoint: /org-storage/leads/save (Beta) Method: POST URL: https://api.phantombuster.com/api/v2/org-storage/leads/save Credentials: Header Base URL: https://api.phantombuster.com/api/v2/org-storage/leads/save Response: Click 'Try It!' to start a request and see the response here! Available Code Examples (not provided): Shell, Node, Ruby, PHP, Python ``` -------------------------------- ### Fetch Agent Groups API Endpoint Source: https://hub.phantombuster.com/reference/get_orgs-fetch-agent-groups Documentation for the `/orgs/fetch-agent-groups` GET API endpoint, which retrieves the agent groups and their order for the current user's organization. It specifies the method, URL, and available languages for code examples. ```APIDOC Endpoint: /orgs/fetch-agent-groups Method: GET URL: https://api.phantombuster.com/api/v2/orgs/fetch-agent-groups Description: Gets the agent groups and order of the current user's organization. Credentials: Header Base URL: https://api.phantombuster.com/api/v2/orgs/fetch-agent-groups Response: Click `Try It!` to start a request and see the response here! Available Languages for Examples: Shell, Node, Ruby, PHP, Python ``` -------------------------------- ### JavaScript Examples for buster.getAgentObject() Source: https://hub.phantombuster.com/reference/buster-getagentobject Illustrative JavaScript code snippets demonstrating how to use the `buster.getAgentObject()` method with modern Async/Await syntax, Promises, and traditional Callbacks (ES5) to retrieve and process agent objects. ```JavaScript /*Bot launched with agentObject: { "name": "nick", "age": 2 } */ const agentId = buster.agentId //Useless try { const object = await buster.getAgentObject(agentId) console.log("The name is", object.name, "and the age is", object.age) //This will print "The name is nick and the age is 2" } catch (err) { console.log("Could not get agent object:", err) } ``` ```JavaScript /*Bot launched with agentObject: { "name": "nick", "age": 2 } */ const agentId = buster.agentId //Useless buster.getAgentObject(agentId) .then((object) => { console.log("The name is", object.name, "and the age is", object.age) //This will print "The name is nick and the age is 2" }) .catch((err) => { console.log("Could not get agent object:", err) }) ``` ```JavaScript /*Bot launched with agentObject: { "name": "nick", "age": 2 } */ var agentId = buster.agentId //Useless buster.getAgentObject(agentId, function(err, object) { if (err) { console.log("Could not get agent object:", err) } else { console.log("The name is", object.name, "and the age is", object.age) //This will print "The name is nick and the age is 2" } }) ``` -------------------------------- ### Phantombuster API v2 Endpoints Reference Source: https://hub.phantombuster.com/reference/buster-download A structured overview of all Phantombuster API v2 endpoints. This reference details the resource categories, their associated paths, and the HTTP methods (GET, POST) supported for each operation. It serves as a quick guide to the available API functionalities. ```APIDOC Phantombuster API v2: branches: GET /branches/fetch-all GET /branches/diff POST /branches/create POST /branches/delete POST /branches/release scripts: GET /scripts/fetch GET /scripts/fetch-all GET /scripts/code POST /scripts/visibility POST /scripts/access-list POST /scripts/save POST /scripts/delete orgs: GET /orgs/export-agent-usage GET /orgs/export-container-usage GET /orgs/fetch-agent-groups POST /orgs/save-agent-groups GET /orgs/fetch GET /orgs/fetch-resources GET /orgs/fetch-running-containers GET /orgs/fetch-crm-access GET /orgs/fetch-crm-resources POST /orgs/save-crm-contact containers: GET /containers/fetch-all GET /containers/fetch-result-object GET /containers/fetch-output GET /containers/fetch agents: POST /agents/launch POST /agents/launch-soon POST /agents/stop POST /agents/unschedule-all GET /agents/fetch-output GET /agents/fetch GET /agents/fetch-all POST /agents/save GET /agents/fetch-deleted POST /agents/delete org-storage: POST /org-storage/leads/save-many POST /org-storage/leads/save POST /org-storage/leads/delete-many POST /org-storage/leads/by-list/{listId} POST /org-storage/lists/save POST /org-storage/lists/delete GET /org-storage/lists/fetch-all GET /org-storage/lists/fetch POST /org-storage/leads-objects/save POST /org-storage/leads-objects/save-many POST /org-storage/leads-objects/delete POST /org-storage/leads-objects/search identities: POST /identities/save-with-token POST /identities/events/save POST /identities/events/search brightdata: GET /brightdata/serp location: GET /location/ip captcha: POST /hcaptcha POST /recaptcha ai: POST /ai/completions POST /ai/advice POST /ai/tasks ``` -------------------------------- ### Phantombuster API v2 Endpoint Reference Source: https://hub.phantombuster.com/reference/get_org-storage-lists-fetch-all Detailed listing of all Phantombuster API v2 endpoints, categorized by resource. Each entry specifies the HTTP method (GET, POST) and the API path. ```APIDOC Phantombuster API v2: branches: GET /branches/fetch-all GET /branches/diff POST /branches/create POST /branches/delete POST /branches/release scripts: GET /scripts/fetch GET /scripts/fetch-all GET /scripts/code POST /scripts/visibility POST /scripts/access-list POST /scripts/save POST /scripts/delete orgs: GET /orgs/export-agent-usage GET /orgs/export-container-usage GET /orgs/fetch-agent-groups POST /orgs/save-agent-groups GET /orgs/fetch GET /orgs/fetch-resources GET /orgs/fetch-running-containers GET /orgs/fetch-crm-access GET /orgs/fetch-crm-resources POST /orgs/save-crm-contact containers: GET /containers/fetch-all GET /containers/fetch-result-object GET /containers/fetch-output GET /containers/fetch agents: POST /agents/launch POST /agents/launch-soon POST /agents/stop POST /agents/unschedule-all GET /agents/fetch-output GET /agents/fetch GET /agents/fetch-all POST /agents/save GET /agents/fetch-deleted POST /agents/delete org-storage: POST /org-storage/leads/save-many POST /org-storage/leads/save POST /org-storage/leads/delete-many POST /org-storage/leads/by-list/{listId} POST /org-storage/lists/save POST /org-storage/lists/delete GET /org-storage/lists/fetch-all GET /org-storage/lists/fetch POST /org-storage/leads-objects/save POST /org-storage/leads-objects/save-many POST /org-storage/leads-objects/delete POST /org-storage/leads-objects/search identities: POST /identities/save-with-token POST /identities/events/save POST /identities/events/search brightdata: GET /brightdata/serp location: GET /location/ip captcha: POST /hcaptcha POST /recaptcha ai: POST /ai/completions POST /ai/advice POST /ai/tasks ``` -------------------------------- ### Phantombuster API v2 Endpoint Overview Source: https://hub.phantombuster.com/reference/get_containers-fetch-all A structured overview of all available API endpoints in Phantombuster API v2. Each entry specifies the HTTP method (GET, POST) and the full endpoint path, categorized by the primary resource they interact with. ```APIDOC Phantombuster API v2: branches: GET /branches/fetch-all GET /branches/diff POST /branches/create POST /branches/delete POST /branches/release scripts: GET /scripts/fetch GET /scripts/fetch-all GET /scripts/code POST /scripts/visibility POST /scripts/access-list POST /scripts/save POST /scripts/delete orgs: GET /orgs/export-agent-usage GET /orgs/export-container-usage GET /orgs/fetch-agent-groups POST /orgs/save-agent-groups GET /orgs/fetch GET /orgs/fetch-resources GET /orgs/fetch-running-containers GET /orgs/fetch-crm-access GET /orgs/fetch-crm-resources POST /orgs/save-crm-contact containers: GET /containers/fetch-all GET /containers/fetch-result-object GET /containers/fetch-output GET /containers/fetch agents: POST /agents/launch POST /agents/launch-soon POST /agents/stop POST /agents/unschedule-all GET /agents/fetch-output GET /agents/fetch GET /agents/fetch-all POST /agents/save GET /agents/fetch-deleted POST /agents/delete org-storage: POST /org-storage/leads/save-many POST /org-storage/leads/save POST /org-storage/leads/delete-many POST /org-storage/leads/by-list/{listId} POST /org-storage/lists/save POST /org-storage/lists/delete GET /org-storage/lists/fetch-all GET /org-storage/lists/fetch POST /org-storage/leads-objects/save POST /org-storage/leads-objects/save-many POST /org-storage/leads-objects/delete POST /org-storage/leads-objects/search identities: POST /identities/save-with-token POST /identities/events/save POST /identities/events/search brightdata: GET /brightdata/serp location: GET /location/ip captcha: POST /hcaptcha POST /recaptcha ai: POST /ai/completions POST /ai/advice POST /ai/tasks ``` -------------------------------- ### Buster save() Function Detailed Reference Source: https://hub.phantombuster.com/reference/buster-save Detailed documentation for the `buster.save()` function, explaining its parameters, their types, and usage examples. ```APIDOC save(urlOrPath [, saveAs, headers, callback]): Description: Saves a distant or local file to your persistent storage. Parameters: urlOrPath: Type: String Description: URL or path of the file to be saved. Examples: - https://www.google.com/images/srpr/logo11w.png (from the web) - foo/my_screenshot.jpg (from your agent's disk) - http://soundcloud.com/ (HTML content of homepage) Notes: - MIME type from Content-Type HTTP header for distant files. - MIME type guessed from file extension for local files. saveAs: Type: String (optional) Description: Where to put the file on your persistent storage. Default: Name will be taken from urlOrPath, saved at root of agent's folder. Notes: - Overwrites if file with same name exists. - Intermediate directories are automatically created. Examples: - foo/ (saves http://example.com/baz/bar.png as foo/bar.png) - null (saves http://example.com/foo/bar.png as bar.png) - foo/ (fails on http://example.com/ with could not determine filename) - foo/a (saves http://example.com/bar.png as foo/a) headers: Type: Plain Object (optional) Description: HTTP headers to use when requesting the file. Notes: Cookies are automatically set when using CasperJS or PhantomJS. ``` -------------------------------- ### PhantomBuster API v1 Endpoints Source: https://hub.phantombuster.com/reference/get_branches-fetch-all Lists the available API v1 endpoints for managing agents, scripts, and user information. This section outlines the various GET and POST methods for interacting with PhantomBuster resources. ```APIDOC API v1: Agent: GET /agent/{id} POST /agent/{id}/launch POST /agent/{id}/abort GET /agent/{id}/output GET /agent/{id}/containers Script: GET /script/by-name/{mode}/{name} POST /script/{name} User: GET /user ``` -------------------------------- ### Phantombuster API v2 Endpoints Overview Source: https://hub.phantombuster.com/reference/post_scripts-delete This section provides a structured overview of all available API endpoints in Phantombuster v2, categorized by resource. Each entry specifies the HTTP method (GET, POST) and the full path for the endpoint. ```APIDOC Phantombuster API v2 Endpoints: branches: GET /branches/fetch-all GET /branches/diff POST /branches/create POST /branches/delete POST /branches/release scripts: GET /scripts/fetch GET /scripts/fetch-all GET /scripts/code POST /scripts/visibility POST /scripts/access-list POST /scripts/save POST /scripts/delete orgs: GET /orgs/export-agent-usage GET /orgs/export-container-usage GET /orgs/fetch-agent-groups POST /orgs/save-agent-groups GET /orgs/fetch GET /orgs/fetch-resources GET /orgs/fetch-running-containers GET /orgs/fetch-crm-access GET /orgs/fetch-crm-resources POST /orgs/save-crm-contact containers: GET /containers/fetch-all GET /containers/fetch-result-object GET /containers/fetch-output GET /containers/fetch agents: POST /agents/launch POST /agents/launch-soon POST /agents/stop POST /agents/unschedule-all GET /agents/fetch-output GET /agents/fetch GET /agents/fetch-all POST /agents/save GET /agents/fetch-deleted POST /agents/delete org-storage: POST /org-storage/leads/save-many POST /org-storage/leads/save POST /org-storage/leads/delete-many POST /org-storage/leads/by-list/{listId} POST /org-storage/lists/save POST /org-storage/lists/delete GET /org-storage/lists/fetch-all GET /org-storage/lists/fetch POST /org-storage/leads-objects/save POST /org-storage/leads-objects/save-many POST /org-storage/leads-objects/delete POST /org-storage/leads-objects/search identities: POST /identities/save-with-token POST /identities/events/save POST /identities/events/search brightdata: GET /brightdata/serp location: GET /location/ip captcha: POST /hcaptcha POST /recaptcha ai: POST /ai/completions POST /ai/advice POST /ai/tasks ``` -------------------------------- ### Phantombuster API v2 Endpoint Reference Source: https://hub.phantombuster.com/reference/post_org-storage-leads-objects-search A complete listing of all Phantombuster API v2 endpoints, organized by resource category. Each entry specifies the HTTP method (GET, POST) and the API path. ```APIDOC Phantombuster API v2 Endpoints: branches: GET /branches/fetch-all GET /branches/diff POST /branches/create POST /branches/delete POST /branches/release scripts: GET /scripts/fetch GET /scripts/fetch-all GET /scripts/code POST /scripts/visibility POST /scripts/access-list POST /scripts/save POST /scripts/delete orgs: GET /orgs/export-agent-usage GET /orgs/export-container-usage GET /orgs/fetch-agent-groups POST /orgs/save-agent-groups GET /orgs/fetch GET /orgs/fetch-resources GET /orgs/fetch-running-containers GET /orgs/fetch-crm-access GET /orgs/fetch-crm-resources POST /orgs/save-crm-contact containers: GET /containers/fetch-all GET /containers/fetch-result-object GET /containers/fetch-output GET /containers/fetch agents: POST /agents/launch POST /agents/launch-soon POST /agents/stop POST /agents/unschedule-all GET /agents/fetch-output GET /agents/fetch GET /agents/fetch-all POST /agents/save GET /agents/fetch-deleted POST /agents/delete org-storage: POST /org-storage/leads/save-many POST /org-storage/leads/save POST /org-storage/leads/delete-many POST /org-storage/leads/by-list/{listId} POST /org-storage/lists/save POST /org-storage/lists/delete GET /org-storage/lists/fetch-all GET /org-storage/lists/fetch POST /org-storage/leads-objects/save POST /org-storage/leads-objects/save-many POST /org-storage/leads-objects/delete POST /org-storage/leads-objects/search identities: POST /identities/save-with-token POST /identities/events/save POST /identities/events/search brightdata: GET /brightdata/serp location: GET /location/ip captcha: POST /hcaptcha POST /recaptcha ai: POST /ai/completions POST /ai/advice POST /ai/tasks ``` -------------------------------- ### Phantombuster API v2 Endpoints Reference Source: https://hub.phantombuster.com/reference/post_org-storage-leads-save Comprehensive reference for all available endpoints in the Phantombuster API v2, categorized by resource. Each entry specifies the HTTP method (GET, POST) and the corresponding API path. ```APIDOC Phantombuster API v2: branches: GET /branches/fetch-all GET /branches/diff POST /branches/create POST /branches/delete POST /branches/release scripts: GET /scripts/fetch GET /scripts/fetch-all GET /scripts/code POST /scripts/visibility POST /scripts/access-list POST /scripts/save POST /scripts/delete orgs: GET /orgs/export-agent-usage GET /orgs/export-container-usage GET /orgs/fetch-agent-groups POST /orgs/save-agent-groups GET /orgs/fetch GET /orgs/fetch-resources GET /orgs/fetch-running-containers GET /orgs/fetch-crm-access GET /orgs/fetch-crm-resources POST /orgs/save-crm-contact containers: GET /containers/fetch-all GET /containers/fetch-result-object GET /containers/fetch-output GET /containers/fetch agents: POST /agents/launch POST /agents/launch-soon POST /agents/stop POST /agents/unschedule-all GET /agents/fetch-output GET /agents/fetch GET /agents/fetch-all POST /agents/save GET /agents/fetch-deleted POST /agents/delete org-storage: POST /org-storage/leads/save-many POST /org-storage/leads/save POST /org-storage/leads/delete-many POST /org-storage/leads/by-list/{listId} POST /org-storage/lists/save POST /org-storage/lists/delete GET /org-storage/lists/fetch-all GET /org-storage/lists/fetch POST /org-storage/leads-objects/save POST /org-storage/leads-objects/save-many POST /org-storage/leads-objects/delete POST /org-storage/leads-objects/search identities: POST /identities/save-with-token POST /identities/events/save POST /identities/events/search brightdata: GET /brightdata/serp location: GET /location/ip captcha: POST /hcaptcha POST /recaptcha ai: POST /ai/completions POST /ai/advice POST /ai/tasks ``` -------------------------------- ### PhantomBuster API v1 Endpoints Overview Source: https://hub.phantombuster.com/reference/post_branches-release This section outlines the available API v1 endpoints for interacting with PhantomBuster agents, scripts, and user data. It provides a structured view of the various GET and POST methods for managing these resources. ```APIDOC API v1: Agent: GET /agent/{id} POST /agent/{id}/launch POST /agent/{id}/abort GET /agent/{id}/output GET /agent/{id}/containers Script: GET /script/by-name/{mode}/{name} POST /script/{name} User: GET /user ``` -------------------------------- ### BrightData SERP API Endpoint Reference Source: https://hub.phantombuster.com/reference/get_brightdata-serp This entry details the `/brightdata/serp` API endpoint, which facilitates performing search operations using BrightData. It specifies the HTTP GET method, the base URL for the API call, and notes the supported client languages (Shell, Node, Ruby, PHP, Python) and the requirement for header-based credentials. ```APIDOC /brightdata/serp: Method: GET URL: https://api.phantombuster.com/api/v2/brightdata/serp Description: Perform a search using brightdata. Supported Languages: Shell, Node, Ruby, PHP, Python Credentials: Header ``` -------------------------------- ### AI Completions API Endpoint Source: https://hub.phantombuster.com/reference/post_ai-completions Documentation for the PhantomBuster AI completions API endpoint. This endpoint allows users to get a completion from the AI, specifying the HTTP method, URL, and supported client languages. ```APIDOC /ai/completions: Method: post URL: https://api.phantombuster.com/api/v2/ai/completions Description: Get a completion from the AI. Supported Languages: Shell, Node, Ruby, PHP, Python Credentials: Header Base URL: https://api.phantombuster.com/api/v2/ai/completions ``` -------------------------------- ### PhantomBuster API v2: Fetch All Organization Storage Lists Source: https://hub.phantombuster.com/reference/get_org-storage-lists-fetch-all Details for the `GET /api/v2/org-storage/lists/fetch-all` endpoint, which allows retrieval of all organization storage lists. This endpoint is currently in Beta and supports various programming languages for client interaction. ```APIDOC Endpoint: /org-storage/lists/fetch-all Method: GET Full URL: https://api.phantombuster.com/api/v2/org-storage/lists/fetch-all Description: Get all the lists - Beta. Credentials: Header Supported Languages: Shell, Node, Ruby, PHP, Python Response: Click `Try It!` to start a request and see the response here! ``` -------------------------------- ### PhantomBuster API v1 Endpoints Overview Source: https://hub.phantombuster.com/reference/get_org-storage-lists-fetch Overview of the PhantomBuster API v1, categorized by resource (Agent, Script, User) and listing available HTTP methods and paths for each. ```APIDOC API v1: Agent: GET /agent/{id} POST /agent/{id}/launch POST /agent/{id}/abort GET /agent/{id}/output GET /agent/{id}/containers Script: GET /script/by-name/{mode}/{name} POST /script/{name} User: GET /user ``` -------------------------------- ### GET /branches/diff API v2 Endpoint Source: https://hub.phantombuster.com/reference/get_branches-diff This API v2 endpoint allows retrieval of the length difference between the staging and release branches for all scripts. It uses a GET request and requires header credentials. Example usage is provided for multiple programming languages. ```APIDOC API Endpoint: /branches/diff Method: GET URL: https://api.phantombuster.com/api/v2/branches/diff Description: Gets the length difference between the staging and release branch of all scripts. Credentials: Header Base URL: https://api.phantombuster.com/api/v2/branches/diff Example Languages: Shell, Node, Ruby, PHP, Python ``` -------------------------------- ### Phantombuster API v2 Endpoints Reference Source: https://hub.phantombuster.com/reference/post_agents-save A complete listing of all API endpoints available in Phantombuster API v2, organized by their respective resource categories (e.g., branches, scripts, agents, org-storage). Each entry specifies the HTTP method (GET, POST) and the endpoint path, providing a quick reference for API integration. ```APIDOC Phantombuster API v2 Endpoints: branches: GET /branches/fetch-all GET /branches/diff POST /branches/create POST /branches/delete POST /branches/release scripts: GET /scripts/fetch GET /scripts/fetch-all GET /scripts/code POST /scripts/visibility POST /scripts/access-list POST /scripts/save POST /scripts/delete orgs: GET /orgs/export-agent-usage GET /orgs/export-container-usage GET /orgs/fetch-agent-groups POST /orgs/save-agent-groups GET /orgs/fetch GET /orgs/fetch-resources GET /orgs/fetch-running-containers GET /orgs/fetch-crm-access GET /orgs/fetch-crm-resources POST /orgs/save-crm-contact containers: GET /containers/fetch-all GET /containers/fetch-result-object GET /containers/fetch-output GET /containers/fetch agents: POST /agents/launch POST /agents/launch-soon POST /agents/stop POST /agents/unschedule-all GET /agents/fetch-output GET /agents/fetch GET /agents/fetch-all POST /agents/save GET /agents/fetch-deleted POST /agents/delete org-storage: POST /org-storage/leads/save-many POST /org-storage/leads/save POST /org-storage/leads/delete-many POST /org-storage/leads/by-list/{listId} POST /org-storage/lists/save POST /org-storage/lists/delete GET /org-storage/lists/fetch-all GET /org-storage/lists/fetch POST /org-storage/leads-objects/save POST /org-storage/leads-objects/save-many POST /org-storage/leads-objects/delete POST /org-storage/leads-objects/search identities: POST /identities/save-with-token POST /identities/events/save POST /identities/events/search brightdata: GET /brightdata/serp location: GET /location/ip captcha: POST /hcaptcha POST /recaptcha ai: POST /ai/completions POST /ai/advice POST /ai/tasks ``` -------------------------------- ### PhantomBuster API v1 Endpoints Overview Source: https://hub.phantombuster.com/reference/get_org-storage-lists-fetch-all Overview of the PhantomBuster API v1 endpoints, categorized by resource (Agent, Script, User), detailing available HTTP methods for each path. ```APIDOC API v1: Agent: GET /agent/{id} POST /agent/{id}/launch POST /agent/{id}/abort GET /agent/{id}/output GET /agent/{id}/containers Script: GET /script/by-name/{mode}/{name} POST /script/{name} User: GET /user ``` -------------------------------- ### Phantombuster API v2 Endpoints Overview Source: https://hub.phantombuster.com/reference/post_identities-events-save This section outlines the available API endpoints for Phantombuster v2, grouped by their primary resource categories. Each entry specifies the API path and the supported HTTP method (GET, POST). This serves as a quick reference for understanding the API's structure and available operations. ```APIDOC Phantombuster API v2: branches: /branches/fetch-all (GET) /branches/diff (GET) /branches/create (POST) /branches/delete (POST) /branches/release (POST) scripts: /scripts/fetch (GET) /scripts/fetch-all (GET) /scripts/code (GET) /scripts/visibility (POST) /scripts/access-list (POST) /scripts/save (POST) /scripts/delete (POST) orgs: /orgs/export-agent-usage (GET) /orgs/export-container-usage (GET) /orgs/fetch-agent-groups (GET) /orgs/save-agent-groups (POST) /orgs/fetch (GET) /orgs/fetch-resources (GET) /orgs/fetch-running-containers (GET) /orgs/fetch-crm-access (GET) /orgs/fetch-crm-resources (GET) /orgs/save-crm-contact (POST) containers: /containers/fetch-all (GET) /containers/fetch-result-object (GET) /containers/fetch-output (GET) /containers/fetch (GET) agents: /agents/launch (POST) /agents/launch-soon (POST) /agents/stop (POST) /agents/unschedule-all (POST) /agents/fetch-output (GET) /agents/fetch (GET) /agents/fetch-all (GET) /agents/save (POST) /agents/fetch-deleted (GET) /agents/delete (POST) org-storage: /org-storage/leads/save-many (POST) /org-storage/leads/save (POST) /org-storage/leads/delete-many (POST) /org-storage/leads/by-list/{listId} (POST) /org-storage/lists/save (POST) /org-storage/lists/delete (POST) /org-storage/lists/fetch-all (GET) /org-storage/lists/fetch (GET) /org-storage/leads-objects/save (POST) /org-storage/leads-objects/save-many (POST) /org-storage/leads-objects/delete (POST) /org-storage/leads-objects/search (POST) identities: /identities/save-with-token (POST) /identities/events/save (POST) /identities/events/search (POST) brightdata: /brightdata/serp (GET) location: /location/ip (GET) captcha: /hcaptcha (POST) /recaptcha (POST) ai: /ai/completions (POST) /ai/advice (POST) /ai/tasks (POST) ``` -------------------------------- ### Phantombuster API v1 Endpoints Overview Source: https://hub.phantombuster.com/reference/buster-apikey This section provides an overview of the Phantombuster API v1, detailing available resources like Agent, Script, and User, along with their respective HTTP methods and paths for interaction. ```APIDOC API v1: Agent: GET /agent/{id} POST /agent/{id}/launch POST /agent/{id}/abort GET /agent/{id}/output GET /agent/{id}/containers Script: GET /script/by-name/{mode}/{name} POST /script/{name} User: GET /user ``` -------------------------------- ### Get PhantomBuster Global Object with Callbacks Source: https://hub.phantombuster.com/reference/buster-getglobalobject Example demonstrating how to retrieve the PhantomBuster global object using a traditional callback function in JavaScript. It checks for errors before processing the retrieved object, assuming the bot is launched with a pre-filled global object. ```JavaScript /*Bot launched with globalObject: { "name": "nick", "age": 2 } */ buster.getGlobalObject(function(err, object) { if (err) { console.log("Could not get the global object:", err) } else { console.log("The name is", object.name, "and the age is", object.age) //This will print "The name is nick and the age is 2" } }) ``` -------------------------------- ### Phantombuster API v2 Endpoint Reference Source: https://hub.phantombuster.com/reference/getagentrecord-1 This section outlines the available resources and their respective API endpoints, including the HTTP methods (GET, POST) for each operation. It serves as a quick reference for developers integrating with the Phantombuster platform. ```APIDOC Phantombuster API v2 Endpoints: Resource: branches - GET /branches/fetch-all - GET /branches/diff - POST /branches/create - POST /branches/delete - POST /branches/release Resource: scripts - GET /scripts/fetch - GET /scripts/fetch-all - GET /scripts/code - POST /scripts/visibility - POST /scripts/access-list - POST /scripts/save - POST /scripts/delete Resource: orgs - GET /orgs/export-agent-usage - GET /orgs/export-container-usage - GET /orgs/fetch-agent-groups - POST /orgs/save-agent-groups - GET /orgs/fetch - GET /orgs/fetch-resources - GET /orgs/fetch-running-containers - GET /orgs/fetch-crm-access - GET /orgs/fetch-crm-resources - POST /orgs/save-crm-contact Resource: containers - GET /containers/fetch-all - GET /containers/fetch-result-object - GET /containers/fetch-output - GET /containers/fetch Resource: agents - POST /agents/launch - POST /agents/launch-soon - POST /agents/stop - POST /agents/unschedule-all - GET /agents/fetch-output - GET /agents/fetch - GET /agents/fetch-all - POST /agents/save - GET /agents/fetch-deleted - POST /agents/delete Resource: org-storage - POST /org-storage/leads/save-many - POST /org-storage/leads/save - POST /org-storage/leads/delete-many - POST /org-storage/leads/by-list/{listId} - POST /org-storage/lists/save - POST /org-storage/lists/delete - GET /org-storage/lists/fetch-all - GET /org-storage/lists/fetch - POST /org-storage/leads-objects/save - POST /org-storage/leads-objects/save-many - POST /org-storage/leads-objects/delete - POST /org-storage/leads-objects/search Resource: identities - POST /identities/save-with-token - POST /identities/events/save - POST /identities/events/search Resource: brightdata - GET /brightdata/serp Resource: location - GET /location/ip Resource: captcha - POST /hcaptcha - POST /recaptcha Resource: ai - POST /ai/completions - POST /ai/advice - POST /ai/tasks ``` -------------------------------- ### Get PhantomBuster Global Object with Promises Source: https://hub.phantombuster.com/reference/buster-getglobalobject Example demonstrating how to retrieve the PhantomBuster global object using Promises in JavaScript. It handles successful retrieval and errors using `.then()` and `.catch()` methods, assuming the bot is launched with a pre-filled global object. ```JavaScript /*Bot launched with globalObject: { "name": "nick", "age": 2 } */ buster.getGlobalObject() .then((object) => { console.log("The name is", object.name, "and the age is", object.age) //This will print "The name is nick and the age is 2" }) .catch((err) => { console.log("Could not get the global object:", err) }) ``` -------------------------------- ### PhantomBuster API v1 Endpoints Overview Source: https://hub.phantombuster.com/reference/get_containers-fetch-output This section provides an overview of the PhantomBuster API v1 endpoints, categorized by resource type. It details the available methods for interacting with agents, scripts, and user information. ```APIDOC API v1: Agent: GET /agent/{id} POST /agent/{id}/launch POST /agent/{id}/abort GET /agent/{id}/output GET /agent/{id}/containers Script: GET /script/by-name/{mode}/{name} POST /script/{name} User: GET /user ``` -------------------------------- ### Get PhantomBuster Global Object with Async/Await Source: https://hub.phantombuster.com/reference/buster-getglobalobject Example demonstrating how to retrieve the PhantomBuster global object using `async/await` syntax in JavaScript. It logs the object's contents or an error if the operation fails, assuming the bot is launched with a pre-filled global object. ```JavaScript /*Bot launched with globalObject: { "name": "nick", "age": 2 } */ try { const object = await buster.getGlobalObject() console.log("The name is", object.name, "and the age is", object.age) //This will print "The name is nick and the age is 2" } catch (err) { console.log("Could not get the global object:", err) } ``` -------------------------------- ### PhantomBuster API v1 Endpoints Overview Source: https://hub.phantombuster.com/reference/post_org-storage-leads-objects-save An overview of the available API v1 endpoints for interacting with PhantomBuster agents, scripts, and user information. This section details the paths and HTTP methods for various operations. ```APIDOC API v1: Agent: GET /agent/{id} POST /agent/{id}/launch POST /agent/{id}/abort GET /agent/{id}/output GET /agent/{id}/containers Script: GET /script/by-name/{mode}/{name} POST /script/{name} User: GET /user ``` -------------------------------- ### PhantomBuster API v1 Endpoints Reference Source: https://hub.phantombuster.com/reference/post_scripts-visibility Lists the available API v1 endpoints for managing agents, scripts, and user information within the PhantomBuster platform. This includes operations for retrieving, launching, aborting, and getting output from agents, as well as managing scripts by name and accessing user data. ```APIDOC API v1: Agent: GET /agent/{id} POST /agent/{id}/launch POST /agent/{id}/abort GET /agent/{id}/output GET /agent/{id}/containers Script: GET /script/by-name/{mode}/{name} POST /script/{name} User: GET /user ``` -------------------------------- ### Phantombuster API v1 and Buster Library Overview Source: https://hub.phantombuster.com/reference/buster-progresshint Comprehensive overview of the Phantombuster API v1 endpoints for agent and script management, along with the core Buster library functions for data manipulation, file handling, and utility operations. Includes detailed documentation for the `progressHint()` method. ```APIDOC API v1: Agent: GET /agent/{id} POST /agent/{id}/launch POST /agent/{id}/abort GET /agent/{id}/output GET /agent/{id}/containers Script: GET /script/by-name/{mode}/{name} POST /script/{name} User: GET /user Buster Library: Methods: save() saveBase64() saveFolder() saveText() mail() pushover() progressHint(progress: Number, label?: String) Description: Reports the progress state of the agent. This affects the width and content of the progress bar displayed in the agent console on Phantombuster. Parameters: progress (Number): Float value between 0 and 1. 1 means 100% of the work was completed. 0 means 0% of the work was completed. label (String, optional): Textual description of the state of your agent (clipped to 50 characters). This shows up as a text inside the progress bar displayed in the agent console. Returns: None (This method does not have a callback. Using await is unnecessary.) setResultObject() download() getAgentObject() getGlobalObject() overrideTimeLimit() setAgentObject() setGlobalObject() solveCaptcha() solveCaptchaBase64() solveCaptchaImage() solveNoCaptcha() getTimeLeft() Properties: agentId apiKey argument containerId retryCount maxRetries proxyAddress ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.