No authentication required
API Documentation
Integrate Bags Labs AI data into your app. Base URL:https://bagslabs.app
X Handle → Wallet
Resolve an X (Twitter) developer tag to a mapped Solana wallet.
Param | Req | Description |
---|---|---|
handle | Yes | X tag without @ |
// JavaScript (fetch, browser or Node 18+)
const base = 'https://bagslabs.app';
async function xToWallet(tag) {
const handle = String(tag).replace(/^@/, '');
const r = await fetch(`${base}/api/twitter-wallet?handle=${encodeURIComponent(handle)}`);
if (!r.ok) throw new Error(await r.text());
const text = await r.text();
try {
return JSON.parse(text); // => { ok: true, wallet: "..." } or { ok:false, error:"..." }
} catch (e) {
throw new Error('Invalid JSON response: ' + text);
}
}
xToWallet('BagsDox').then(console.log).catch(console.error);
Wallet → X Accounts
Find Twitter accounts linked to a Solana wallet through BAGS token launches.
Param | Req | Description |
---|---|---|
wallet | Yes | Solana wallet address |
pages | No | Transaction pages to scan (1-10, default 5) |
limit | No | Transactions per page (50-100, default 100) |
// JavaScript — Find Twitter accounts linked to wallet
const base = 'https://bagslabs.app';
async function walletToTwitter(wallet, pages = 5) {
const url = `${base}/api/wallet-twitter?wallet=${encodeURIComponent(wallet)}&pages=${pages}`;
const r = await fetch(url);
if (!r.ok) throw new Error(await r.text());
const text = await r.text();
try {
return JSON.parse(text); // { ok:true, wallet, twitters:[], creators:[], scanned:{} }
} catch (e) {
throw new Error('Invalid JSON response: ' + text);
}
}
walletToTwitter('Da63jxs5D5G...Jffe9Y', 5).then(console.log);
Wallet Tokens
Get tokens launched or co-created by a wallet address.
Param | Req | Description |
---|---|---|
wallet | Yes | Solana wallet address |
// JavaScript — Get tokens launched by wallet
const base = 'https://bagslabs.app';
async function walletCoins(wallet) {
const r = await fetch(`${base}/api/wallet-coins?wallet=${encodeURIComponent(wallet)}`);
if (!r.ok) throw new Error(await r.text());
const text = await r.text();
try {
return JSON.parse(text); // { ok:true, data:[{ mint, role, twitter, username, royaltyPct }] }
} catch (e) {
throw new Error('Invalid JSON response: ' + text);
}
}
walletCoins('Da63jxs5D5G...Jffe9Y').then(console.log);
Token Creators
Find creators and fee shares for a token contract address (CA).
Param | Req | Description |
---|---|---|
ca | Yes | Token mint (CA), base58 |
// JavaScript — Token creators/fee-shares by mint (CA)
const base = 'https://bagslabs.app';
async function tokenCreators(ca) {
const r = await fetch(`${base}/api/token-creators?ca=${encodeURIComponent(ca)}`);
if (!r.ok) throw new Error(await r.text());
const text = await r.text();
try {
return JSON.parse(text); // { ok:true, data:[{ username, twitterUsername, wallet, royaltyPct, isCreator, pfp }]}
} catch (e) {
throw new Error('Invalid JSON response: ' + text);
}
}
tokenCreators('So11111111111111111111111111111111111111112').then(console.log);
Wallet Reliability
AI-powered reliability analysis using on-chain activity.
Param | Req | Description |
---|---|---|
address | Yes | Solana wallet address |
pages | No | 1–10 transaction pages to scan (default 5) |
// JavaScript — AI wallet reliability (Solana)
const base = 'https://bagslabs.app';
async function walletReliability(address, pages = 5) {
const url = `${base}/api/analyze/wallet-reliability?address=${encodeURIComponent(address)}&pages=${pages}`;
const r = await fetch(url);
if (!r.ok) throw new Error(await r.text());
const text = await r.text();
try {
return JSON.parse(text); // { ok:true, score: number, details:{ ... } }
} catch (e) {
throw new Error('Invalid JSON response: ' + text);
}
}
walletReliability('Da63jxs5D5G...Jffe9Y', 5).then(console.log);
Respect rate limits, debounce client calls, and cache responses where possible. See also API Documentation.