Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Get Filtered Tokens

POSThttps://deep-index.moralis.io/api/v2.2/discovery/tokens

Returns filtered tokens based on specified metrics and criteria.

BODY PARAM
chainstringrequired
The chain ID in hex format
filtersarrayrequired
Array of filter criteria
filters[0]
metricstring
The metric to filter on
timeFramestring
The time frame for the filter
gtstring
Greater-than value for the filter.
ltstring
Less-than value for the filter.
eqstring
Equal to value for the filter.
sortByobject
Sorting criteria
metricstringrequired
Metric to sort by
timeFramestringrequired
Time frame for the metric
typestringrequired
Sort direction (ASC or DESC)
timeFramesToReturnarray
List of time frames to include in the response.
No items in the array
metricsToReturnarray
Metrics to include in response
No items in the array
limitnumber
Maximum number of results to return
Responses
API KEY
// Dependencies to install:
// $ npm install node-fetch --save
// add "type": "module" to package.json

import fetch from 'node-fetch';

const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
},
body: JSON.stringify({
"chain": "0x1",
"filters": [
{
"metric": "experiencedBuyers",
"timeFrame": "oneMonth",
"gt": "10"
}
],
"sortBy": {
"metric": "experiencedBuyers",
"timeFrame": "oneMonth",
"type": "DESC"
},
"limit": 5
})
};

fetch('https://deep-index.moralis.io/api/v2.2/discovery/tokens', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response Example
{
"metadata": {
"tokenAddress": "0x55d398326f99059ff775485246999027b3197955",
"chainId": "0x1",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 18,
"logo": "https://example.com/logo.png",
"blockNumberMinted": 176416,
"usdPrice": 0.9982436729635321,
"security": {
"isOpenSource": true,
"isProxy": "",
"isMintable": true,
"hiddenOwner": "",
"buyTax": "0",
"sellTax": "0",
"cannotBuy": "",
"cannotSellAll": "",
"isHoneyPot": ""
}
}
}