Agents API is used to manage agents under an account. Use this API to fetch all agents, fetch agent by id, clone an agent, delete an agent, etc.
Get all agents
This API fetches all the active agents under an account.
Endpoint:
Method: GET
URL: https://api.agenty.com/v2/agents
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} | |
offset | {{OFFSET}} | |
limit | {{LIMIT}} | |
sort | {{SORT}} | |
order | {{ORDER}} |
Responses:
Status: OK | Code: 200
{
"total": 2,
"limit": 5,
"offset": 0,
"returned": 2,
"result": [
{
"agent_id": "eo1g2l00lr",
"project_id": null,
"name": "Books price scraping agent",
"description": "This agent will extract the product list, prices, image and detail page hyperlink from books.toscrape.com website",
"type": "scraping",
"tags": [],
"icon": null,
"version": 1,
"created_at": "2022-01-10T04:14:18Z",
"updated_at": null,
"is_public": false,
"scheduler": null,
"last_job": null
},
{
"agent_id": "45zly5keqr",
"project_id": null,
"name": "eCommerce product scraper",
"description": "This agent will scrape the demo product and prices from the source URL.",
"type": "scraping",
"tags": [],
"icon": null,
"version": 1,
"created_at": "2022-01-10T04:13:52Z",
"updated_at": null,
"is_public": false,
"scheduler": null,
"last_job": null
}
]
}
Get agent by agent id
This API will fetch the agent by given agent id.
Endpoint:
Method: GET
URL: https://api.agenty.com/v2/agents/{{AGENT_ID}}
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: Ok | Code: 200
{
"agent_id": "eo1g2l00lr",
"account_id": 14,
"user_id": 29,
"project_id": null,
"name": "Books price scraping agent",
"description": "This agent will extract the product list, prices, image and detail page hyperlink from books.toscrape.com website",
"type": "scraping",
"tags": [],
"version": 1,
"config": {
"url": "http://books.toscrape.com/",
"collections": [
{
"name": "Collection1",
"fields": [
{
"name": "name",
"type": "CSS",
"selector": "#ajax-load-more h3",
"extract": "TEXT",
"attribute": null,
"from": null,
"join": false
},
{
"name": "date",
"type": "CSS",
"selector": ".entry-meta",
"extract": "TEXT",
"attribute": null,
"from": null,
"join": false
},
{
"name": "discription",
"type": "CSS",
"selector": ".entry-meta+ p",
"extract": "TEXT",
"attribute": null,
"from": null,
"join": false
},
{
"name": "image",
"type": "CSS",
"selector": "#ajax-load-more .wp-post-image",
"extract": "ATTR",
"attribute": "src",
"from": null,
"join": false
}
],
"query": null
}
],
"browser": "agenty",
"user_agent": null,
"wait_for": {
"type": "selector",
"value": null,
"hidden": false,
"visible": false,
"timeout": 0
},
"go_to_options": {
"timeout": 500,
"wait_until": [],
"referer": null
},
"device": "desktop",
"frame": null,
"viewport": {
"width": 1920,
"height": 969
},
"authenticate": null,
"login": {
"enabled": false,
"actions": []
},
"logout": {
"enabled": false,
"actions": []
},
"pagination": {
"enabled": true,
"type": "click",
"value": null,
"container": null,
"max_pages": 10
},
"headers": [],
"retry": {
"enabled": true,
"max_try": 0,
"try_interval": 0
},
"form": {
"enabled": false,
"actions": []
},
"lazy_load": false,
"block_ads": true,
"block_trackers": true,
"set_javascript_enabled": true,
"reject_resource_types": [],
"reject_request_pattern": [],
"code": null,
"developer_mode": false,
"anonymous": {
"proxy": true,
"proxy_type": null,
"country": null,
"skip_resource_types": []
}
},
"is_public": false,
"is_managed": false,
"created_at": "2022-01-10T04:14:18Z",
"updated_at": null,
"icon": null,
"scheduler": null,
"scripts": null
}
Clone agent by id
This API will clone the agent and also copy the input URLs if the input type is manual or source URL.
Endpoint:
Method: GET
URL: https://api.agenty.com/v2/agents/{{AGENT_ID}}/clone
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: OK | Code: 200
{
"agent_id": "eo1g2l00lr",
"account_id": 14,
"user_id": 29,
"project_id": null,
"name": "Books price scraping agent",
"description": "This agent will extract the product list, prices, image and detail page hyperlink from books.toscrape.com website",
"type": "scraping",
"tags": [],
"version": 1,
"config": {
"url": "http://books.toscrape.com/",
"collections": [
{
"name": "Collection1",
"fields": [
{
"name": "name",
"type": "CSS",
"selector": "#ajax-load-more h3",
"extract": "TEXT",
"attribute": null,
"from": null,
"join": false
},
{
"name": "date",
"type": "CSS",
"selector": ".entry-meta",
"extract": "TEXT",
"attribute": null,
"from": null,
"join": false
},
{
"name": "discription",
"type": "CSS",
"selector": ".entry-meta+ p",
"extract": "TEXT",
"attribute": null,
"from": null,
"join": false
},
{
"name": "image",
"type": "CSS",
"selector": "#ajax-load-more .wp-post-image",
"extract": "ATTR",
"attribute": "src",
"from": null,
"join": false
}
],
"query": null
}
],
"browser": "agenty",
"user_agent": null,
"wait_for": {
"type": "selector",
"value": null,
"hidden": false,
"visible": false,
"timeout": 0
},
"go_to_options": {
"timeout": 500,
"wait_until": [],
"referer": null
},
"device": "desktop",
"frame": null,
"viewport": {
"width": 1920,
"height": 969
},
"authenticate": null,
"login": {
"enabled": false,
"actions": []
},
"logout": {
"enabled": false,
"actions": []
},
"pagination": {
"enabled": true,
"type": "click",
"value": null,
"container": null,
"max_pages": 10
},
"headers": [],
"retry": {
"enabled": true,
"max_try": 0,
"try_interval": 0
},
"form": {
"enabled": false,
"actions": []
},
"lazy_load": false,
"block_ads": true,
"block_trackers": true,
"set_javascript_enabled": true,
"reject_resource_types": [],
"reject_request_pattern": [],
"code": null,
"developer_mode": false,
"anonymous": {
"proxy": true,
"proxy_type": null,
"country": null,
"skip_resource_types": []
}
},
"is_public": false,
"is_managed": false,
"created_at": "2022-01-10T04:14:18Z",
"updated_at": null,
"icon": null,
"scheduler": null,
"scripts": null
}
Delete agent by id
This API will delete the agent permanently by given the agent id.
Endpoint:
Method: DELETE
URL: https://api.agenty.com/v2/agents/{{AGENT_ID}}
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: OK | Code: 200
{
"status_code": 200,
"message": "1 agent(s) deleted successfully"
}