Use the official apify-client SDK to run the DeFiLlama Yield Scanner and pull results into your Node app. These are client-side usage examples.
npm install apify-clientSet your token (from Apify → Integrations):
export APIFY_TOKEN=apify_api_xxxxxxxxxxxxxxxxxxxxximport { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('logiover/defillama-yield-scanner').call({
chains: ['Ethereum', 'Solana'],
minApy: 8,
minTvlUsd: 1_000_000,
sort: 'apy',
maxResults: 250,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Got ${items.length} pools`);
console.table(
items.slice(0, 10).map((p) => ({
project: p.project,
symbol: p.symbol,
chain: p.chain,
apy: p.apy,
tvlUsd: p.tvlUsd,
})),
);import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('logiover/defillama-yield-scanner').call({
stablecoinOnly: true,
minApy: 6,
minTvlUsd: 1_000_000,
sort: 'apy',
maxResults: 200,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
const top = items
.filter((p) => p.ilRisk === 'no')
.sort((a, b) => b.apy - a.apy)
.slice(0, 15);
for (const p of top) {
console.log(`${p.apy.toFixed(2)}% ${p.symbol.padEnd(12)} ${p.project} (${p.chain})`);
}import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('logiover/defillama-yield-scanner').call({
projects: ['aave', 'compound', 'morpho', 'spark'],
sort: 'apy',
maxResults: 2000,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
const usdc = items.filter((p) => p.symbol === 'USDC');
console.table(
usdc.map((p) => ({ project: p.project, chain: p.chain, apy: p.apy, tvlUsd: p.tvlUsd })),
);import { ApifyClient } from 'apify-client';
import { writeFile } from 'node:fs/promises';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('logiover/defillama-yield-scanner').call({ sort: 'tvl', maxResults: 5000 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
await writeFile('yields.json', JSON.stringify(items, null, 2));
console.log(`Saved ${items.length} pools to yields.json`);See the full input/output reference in the main README.