Search…
⌃K

Dataset API

Overview

Using Datasets can bring a whole new layer to your Smart Triggers and it can make writing your ParsiQL code less bulky. Instead of using the web interface to modify it, our API gives you a way to dynamically modify Dataset entries, e.g. for adding new monitoring addresses programmatically.

Obtaining necessary information

Obtaining an API key

Navigate to PARSIQ Portal and press copy to clipboard button in project's dashboard on the right.
Copying project's ID from project's dashboard
Alternatively, you can go to View All Projects in the sidebar, then press " ⋮ " button next to the project of interest.
Copying project's ID from the projects list

Retrieving Datasets

DATASET_TABLE_ID can be found in the interface by pressing " ⋮ " button near the desired dataset.

Supported commands and examples

Our API supports the following commands
Command
Description
GET
to read Datasets
POST
to insert Datasets
PATCH
to update (and insert) Datasets
DELETE
to delete Datasets
PUT
to completely replace Datasets

How to use them

For example, we have a Dataset table with this info

GET command

To retrive your Dataset, use this command
curl --location --request GET 'https://api.parsiq.net/v1/data/DATASET_TABLE_ID'
--header 'Authorization: Bearer YOUR_API_KEY'

POST command

To add new rows to your Dataset table, use this command. In this example, two new rows will be added to our Dataset.
curl --location --request POST 'https://api.parsiq.net/v1/data/DATASET_TABLE_ID'
--header 'Authorization: Bearer YOUR_API_KEY'
--header 'Content-Type: application/json'
--data-raw
'
[
{
"coin": "testcoin2",
"symbol": "test2",
"address": "0xde2d9bf936097395c5EFA0951820DaF49e0065F6"
},
{
"coin": "testcoin3",
"symbol": "test3",
"address": "0x85b3bA386648a0012EE0ff67E7B1701B3ceCf920"
}
]'
Updated Dataset Table with 2 new addresses

PATCH command

If you need to update the info in Dataset, you can use the patch command. It can also be used to add new rows to your table. in this example we will update the first row and add a new one.
curl --location --request PATCH 'https://api.parsiq.net/v1/data/DATASET_TABLE_ID'
--header 'Authorization: Bearer YOUR_API_KEY'
--header 'Content-Type: application/json'
--data-raw
'
[
{
"coin": "testcoinPATCH",
"symbol": "PATCH",
"address": "0x26a601ac8a07e1c8b27bd2a5f05d6ec89fe7c100"
},
{
"coin": "NewCoin",
"symbol": "NEW",
"address": "0xf89d7b9c864f589bbF53a82105107622B35EaA40"
}
]'
Patched Dataset table

DELETE command

To delete an address row, we need to add an address you want to remove to API's URL. In this example we will remove the second address from our table
curl --location --request DELETE 'https://api.parsiq.net/v1/data/DATASET_TABLE_ID/0x847b144a9e84a68dc0af9dafd3ca98847d7c1551'
--header 'Authorization: Bearer YOUR_API_KEY'
Updated table after DELETE command

PUT command

Use this to entirely replace rows of your Dataset Table. Technically you can update, delete and post new rows with this command if you would put an entire updated list of your desired addresses. But in this example, we will put 2 new addresses instead of 4 old ones.
curl --location --request PUT 'https://api.parsiq.net/v1/data/DATASET_TABLE_ID/'
--header 'Authorization: Bearer YOUR_API_KEY'
--header 'Content-Type: application/json'
--data-raw
'
[
{
"coin": "PutCoin1",
"symbol": "PUT1",
"address": "0xB14b407607A5Dfce792AdD5F27d9e470d78dAA3c"
},
{
"coin": "PutCoin2",
"symbol": "PUT2",
"address": "0xc2a483f696d46886b3bd82947e40c442153848ea"
}
]'
Our table with the new address we put in