API Documentation

Build powerful integrations with the NFT.Radio API

Base URL

https://api.nft.radio/v1

Authentication

Bearer token via wallet signature

Rate Limiting

1000 requests/hour per API key

Authentication

Wallet-based Authentication

NFT.Radio uses wallet-based authentication. Sign a message with your wallet to receive an access token.

Request Example

POST /auth/wallet
Content-Type: application/json

{
  "walletAddress": "0x...",
  "signature": "0x...",
  "message": "Sign this message to authenticate..."
}

Response

{
  "accessToken": "eyJhbGc...",
  "refreshToken": "eyJhbGc...",
  "tokenType": "Bearer",
  "expiresIn": 3600
}

Using the token: Include the access token in the Authorization header for all authenticated requests:

Authorization: Bearer <access_token>

Tracks

Endpoints for managing and streaming tracks

GET/tracksList all tracks
GET/tracks/:idGet track by ID
GET/tracks/trendingGet trending tracks
GET/tracks/searchSearch tracks
POST/tracksUpload a new track
GET/tracks/:id/streamGet stream URL

Example

JavaScript
// Fetch trending tracks and parse the response
const response = await fetch("https://api.nft.radio/v1/tracks/trending?limit=10", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <access_token>",
    "Content-Type": "application/json",
  },
});

const data = await response.json();

// data.tracks is an array of track objects
for (const track of data.tracks) {
  console.log(`${track.title} by ${track.artist} — ${track.plays} plays`);
}

Videos

Endpoints for video content

GET/videosList all videos
GET/videos/:idGet video by ID
POST/videos/upload/initiateInitiate video upload
PUT/videos/upload/:id/chunkUpload video chunk
POST/videos/upload/:id/completeComplete video upload

NFTs

NFT marketplace endpoints

GET/nftsList all NFTs
GET/nfts/:idGet NFT by ID
POST/nfts/mintMint a new NFT
GET/listingsGet marketplace listings
POST/listingsCreate a listing
POST/listings/:id/purchasePurchase NFT

Example

JavaScript
// Purchase an NFT from a marketplace listing
const listingId = "listing_abc123";

const response = await fetch(`https://api.nft.radio/v1/listings/${listingId}/purchase`, {
  method: "POST",
  headers: {
    "Authorization": "Bearer <access_token>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    buyerWallet: "0x1234...abcd",
    paymentToken: "ETH",
    maxPrice: "0.5",
  }),
});

const result = await response.json();
console.log("Transaction hash:", result.transactionHash);
console.log("NFT transferred:", result.nft.tokenId);

Users

User management endpoints

GET/users/meGet current user
PATCH/users/meUpdate profile
GET/users/:idGet user by ID
POST/users/:id/followFollow a user
DELETE/users/:id/followUnfollow a user

Example

JavaScript
// Get the current user profile
const profileRes = await fetch("https://api.nft.radio/v1/users/me", {
  headers: {
    "Authorization": "Bearer <access_token>",
  },
});
const profile = await profileRes.json();
console.log("Username:", profile.username);

// Update the current user profile
const updateRes = await fetch("https://api.nft.radio/v1/users/me", {
  method: "PATCH",
  headers: {
    "Authorization": "Bearer <access_token>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    displayName: "New Display Name",
    bio: "Music producer & NFT collector",
    avatarUrl: "https://example.com/avatar.png",
  }),
});
const updated = await updateRes.json();
console.log("Profile updated:", updated.displayName);