Attention all developers! You can use the PhantomBuster API to have control over your account. It is composed of HTTPS endpoints returning JSON data. The API allows you to launch and abort agents, get console output, status, progress, and messages from an agent, and more.
Enabling developer mode
If you signed up as a developer on PhantomBuster, the developer mode is enabled by default. If not, head over to your User settings page and click "Enable developer mode."
PhantomBuster's developer mode adds developer-specific advanced options across the website.
The developer mode will unlock features such as "Edit code" for your custom scripts or code snippets to easily use our API. To see all developer features, check out Developers: Enable developer features.
Check out this Developer quick start for a step-by-step guide on important PhantomBuster terms, what agents (aka Phantoms) are made of, how to create and code your own custom script, and other useful things.
Your API key can be found in your Org settings. Access these settings by clicking your name in the upper right corner of the Navigation Bar:
You will find more information on how our API endpoints URLs are formatted and other information regarding the version, how to manage and secure your API key, authentication, and errors in this guide. To launch a Phantom via API call, see this documentation.
You can see the argument to send in the Phantom's Setup by clicking on the three dots in the top right, then "Switch to JSON."
If you want to perform some actions after the execution of your Phantom, you can look into the webhook system.
Get Phantom's results via API call
In order to get the CSV/JSON file link through the API, you will need to launch a Phantom and use the endpoint.
This second step will give you some data, where you'll find two things that will interest you:
Then you will just have to recreate the link. For example:
- JSON > https://phantombuster.s3.amazonaws.com/orgS3Folder/s3Folder/NAME_OF_YOUR_RESULT_FILE.json
- CSV > https://phantombuster.s3.amazonaws.com/orgS3Folder/s3Folder/NAME_OF_YOUR_RESULT_FILE.csv