API Documentation

Tech Center Content API

Endpoint
POSThttps://idxsolana.io/api/tech-center/content
Description
This API allows integration of tech center videos and blog content into your platform. Content can be filtered by category, type, and date range.
Authentication
API key required in headers: X-API-KEY

Request Parameters

The request body should be a JSON object containing:

ParameterTypeRequiredDescription
content_typeStringYesType of content: "video", "blog", or "all"
categoryStringNoFilter by category (e.g., "blockchain", "defi", "nft")
limitIntegerNoNumber of items to return (default: 10, max: 50)
offsetIntegerNoPagination offset (default: 0)
date_fromStringNoFilter content published after this date (ISO format)
date_toStringNoFilter content published before this date (ISO format)

Example Request

{
  "content_type": "video",
  "category": "blockchain",
  "limit": 5,
  "offset": 0,
  "date_from": "2023-01-01T00:00:00Z"
}

Response Format

Success Response (200 OK)

{
  "status": 200,
  "error": false,
  "message": "Success",
  "data": {
    "total_count": 42,
    "returned_count": 5,
    "items": [
      {
        "id": "v12345",
        "type": "video",
        "title": "Understanding Blockchain Fundamentals",
        "description": "A deep dive into blockchain technology basics",
        "thumbnail_url": "https://idxsolana.io/images/thumbnails/v12345.jpg",
        "content_url": "https://idxsolana.io/videos/v12345",
        "embed_code": "<iframe src='https://idxsolana.io/embed/v12345' width='560' height='315' frameborder='0'></iframe>",
        "duration": 1245,
        "category": "blockchain",
        "tags": ["beginner", "education", "technology"],
        "published_at": "2023-03-15T14:30:00Z",
        "author": {
          "name": "Alex Johnson",
          "profile_url": "https://idxsolana.io/authors/alexj"
        }
      },
      // Additional items...
    ]
  }
}

Sample API Call

fetch('https://idxsolana.io/api/tech-center/content', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your_api_key_here'
  },
  body: JSON.stringify({
    "content_type": "video",
    "category": "blockchain",
    "limit": 5,
    "offset": 0,
    "date_from": "2023-01-01T00:00:00Z"
  }),
})
.then(response => response.json())
.then(data => {
  // Process and display the content
  const contentContainer = document.getElementById('tech-content');
  data.data.items.forEach(item => {
    const contentElement = document.createElement('div');
    contentElement.className = 'content-item';
    contentElement.innerHTML = `
      <h3>${item.title}</h3>
      <div class="thumbnail">
        <img src="${item.thumbnail_url}" alt="${item.title}">
      </div>
      <p>${item.description}</p>
      <div class="embed">${item.embed_code}</div>
    `;
    contentContainer.appendChild(contentElement);
  });
})
.catch(error => console.error('Error:', error));

Token Price API

Endpoint
GEThttps://idxsolana.io/api/token/prices
Description
This API provides real-time price data for various cryptocurrency tokens, with a focus on IDX and Solana ecosystem tokens.
Authentication
Public API with rate limits. API key required for higher rate limits .

Request Parameters

The following query parameters are supported:

ParameterTypeRequiredDescription
symbolsStringNoComma-separated list of token symbols (e.g., "IDX,SOL,BTC"). If omitted, returns data for all available tokens.

Example Request

// Basic request for current prices
GET https://idxsolana.io/api/token/prices?symbols=IDX,SOL,BTC&currency=USD


Response Format

Success Response - Current Prices (200 OK)

{
  "status": 200,
  "error": false,
  "timestamp": 1679529600,
  "base": "USD",
  "data": {
    "IDX": {
      "price": 2.45,
      "market_cap": 245000000,
      "volume_24h": 12450000,
      "change_24h": 5.23,
      "last_updated": 1679529540
    },
    "SOL": {
      "price": 137.82,
      "market_cap": 58564876543,
      "volume_24h": 2345675432,
      "change_24h": -1.21,
      "last_updated": 1679529550
    },
    "BTC": {
      "price": 59874.32,
      "market_cap": 1143585432567,
      "volume_24h": 34758392846,
      "change_24h": 2.34,
      "last_updated": 1679529552
    }
  }
}

Sample API Call

// Fetch current token prices and update UI
fetch('https://idxsolana.io/api/token/prices?symbols=IDX,SOL,BTC&currency=USD')
  .then(response => response.json())
  .then(data => {
    if (!data.error) {
      // Update price displays
      Object.keys(data.data).forEach(symbol => {
        const tokenData = data.data[symbol];
        const priceElement = document.getElementById(`${symbol}-price`);
        const changeElement = document.getElementById(`${symbol}-change`);
        
        if (priceElement) {
          priceElement.textContent = `$${tokenData.price.toFixed(2)}`;
        }
        
        if (changeElement) {
          const changeValue = tokenData.change_24h;
          changeElement.textContent = `${changeValue > 0 ? '+' : ''}${changeValue.toFixed(2)}%`;
          changeElement.className = changeValue >= 0 ? 'text-green-500' : 'text-red-500';
        }
      });
      
      // Update last updated timestamp
      document.getElementById('last-updated').textContent = 
        `Last updated: ${new Date(data.timestamp * 1000).toLocaleTimeString()}`;
    }
  })
  .catch(error => console.error('Error fetching token prices:', error));