API documentation
Using the API, in short
- Find a bot you need to use
- Provide the main input, additional parameters
- Start the bot. The bot will start a JOB and will provide a unique JOB_ID which you will need to inspect for results later.
- When inspecting the JOB you will see a list of DATA RUNS.
- Each DATA RUN contains a JSON with results that you can download.
Getting your API key
Your API token (API_TOKEN) is available on your Settings page: https://botster.io/settings
KEEP YOUR TOKEN SAFE.
You can reset your token at any time.
API commands
Checking your credits amount:
curl 'https://botster.io/api/v2/credits' \ -H 'Authorization: Bearer API_TOKEN'
List available bots:
curl '<https://botster.io/api/v2/bots?page=1&per=50>' \ -H 'Authorization: Bearer API_TOKEN'
Find bots that match a specific query:
curl '<https://botster.io/api/v2/bots?search=scraping>' \ -H 'Authorization: Bearer API_TOKEN'
Launching a bot. "Input" used as the main input of the bot. Other options are supplied as key-values:
curl '<https://botster.io/api/v2/bots/linkedin-profile-scraper>' \ -H 'Authorization: Bearer API_TOKEN' \ -H 'Content-Type: application/json' \ -X POST \ -d '{"input": "<https://linkedin.com/link1 \n https://linkedin.com/link2>", "some_param": "abc123"}'
Check the cost of launching a bot with your parameters:
curl '<https://botster.io/api/v2/bots/linkedin-profile-scraper/calculate>' \ -H 'Authorization: Bearer API_TOKEN' \ -H 'Content-Type: application/json' \ -X POST \ -d '{"input": "<https://linkedin.com/link1 \n https://linkedin.com/link2>", "some_param": "abc123"}'
List your jobs:
curl '<https://botster.io/api/v2/jobs?page=1&per=50>' \ -H 'Authorization: Bearer API_TOKEN'
Get job information, get result data:
curl '<https://botster.io/api/v2/jobs/6e9c-4e8e-a75a>' \ -H 'Authorization: Bearer API_TOKEN'
Get JSON with your results:
curl '<https://botster.io/api/v2/runs/74f1f559-aeea-4b96-9742-81e1d14d16d5>' \ -H 'Authorization: Bearer API_TOKEN'
Delete a job:
DELETE <https://botster.io/api/v2/jobs/{uuid}>
Archive a job:
POST <https://botster.io/api/v2/jobs/{uuid}/archive>
UN-archive a job:
POST <https://botster.io/api/v2/jobs/{uuid}/unarchive>
Delete a RUN:
DELETE <https://botster.io/api/v2/runs/{uuid}>
RESTART a job:
POST <https://botster.io/api/v2/jobs/{uuid}/restart>
ASK the bot to send a JSON POST with the results on job completion to your webhook:
-d '{"input": ["<https://example.com>"], "webhook": "<https://example.com/output>"}'
Example usage
We'll be using this bot for the demo: https://botster.io/bots/contact-data-scraper
We will be scanning these pages: www.example.com and www.example.com/about for contact data:
curl '<https://botster.io/api/v2/bots/contact-data-scraper>' \ -X POST \ -H 'Authorization: Bearer 1234567890' \ -H 'Content-Type: application/json' \ -d '{"input": "<https://www.example.com> \n https://www.example.com/about", "max_pages": "100", "contact_filter": {"filter":["email","phone","facebook","linkedin","whatsapp"]}}'
Another example:
curl <https://botster.io/api/v2/bots/linkedin-profile-scraper/calculate> -H 'Authorization: Bearer <API KEY>' -XPOST -H 'Content-Type: application/json' -d '{ "scrape_experience": 0, "scrape_options":["education"], "input": "<https://www.linkedin.com/in/><URL>" }'