API Documentation

Integrate with the VALYGO NFT Marketplace programmatically.

Overview

Base URL: https://nft.vyochain.com

Auth: X-API-Key: vyo_... header

Chain: NFTChain (ID 7773777) | Protocol: Seaport v1.6

Authentication

GET/api/v1/register/challenge?wallet=0x...

Get challenge message to sign

Terminal
curl https://nft.vyochain.com/api/v1/register/challenge?wallet=0xYOUR_WALLET
Browser (JavaScript)
const res = await fetch("/api/v1/register/challenge?wallet=" + address);
const { message } = await res.json();
POST/api/v1/register

Submit signature to get API key

Terminal
curl -X POST https://nft.vyochain.com/api/v1/register \
  -H "Content-Type: application/json" \
  -d '{"wallet":"0x...","signature":"0x...","name":"My App"}'
Browser (JavaScript)
const sig = await signer.signMessage(message);
const res = await fetch("/api/v1/register", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ wallet: address, signature: sig, name: "My App" })
});
const { key } = await res.json();

Minting

POST/api/v1/mint

Mint NFT (gas sponsored). Auth: X-API-Key

Terminal
curl -X POST https://nft.vyochain.com/api/v1/mint \
  -H "Content-Type: application/json" \
  -H "X-API-Key: vyo_YOUR_KEY" \
  -d '{"collection":"0x...","to":"0x...","name":"NFT #1","image":"ipfs://Qm...","attributes":[{"trait_type":"Rarity","value":"Legendary"}]}'
Browser (JavaScript)
const res = await fetch("/api/v1/mint", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": "vyo_YOUR_KEY"
  },
  body: JSON.stringify({
    collection: "0x...",
    to: recipient,
    name: "My NFT",
    image: "ipfs://QmHash",
    attributes: [{ trait_type: "Rarity", value: "Legendary" }]
  })
});
const { txHash, tokenId, marketplaceUrl } = await res.json();

Reading Data

GET/api/v1/nfts?collection=0x...

Get NFTs by collection. Auth: X-API-Key

Terminal
curl https://nft.vyochain.com/api/v1/nfts?collection=0x... \
  -H "X-API-Key: vyo_YOUR_KEY"
Browser (JavaScript)
const res = await fetch("/api/v1/nfts?collection=" + addr, {
  headers: { "X-API-Key": "vyo_YOUR_KEY" }
});
const { tokens } = await res.json();
GET/api/v1/collections/:address

Get collection stats. Auth: X-API-Key

Terminal
curl https://nft.vyochain.com/api/v1/collections/0xADDRESS \
  -H "X-API-Key: vyo_YOUR_KEY"
Browser (JavaScript)
const res = await fetch("/api/v1/collections/" + addr, {
  headers: { "X-API-Key": "vyo_YOUR_KEY" }
});
const { name, totalSupply, floorPrice } = await res.json();

Listing

POST/api/v1/list

List NFT for sale (signed Seaport order). Auth: X-API-Key

Terminal
curl -X POST https://nft.vyochain.com/api/v1/list \
  -H "Content-Type: application/json" \
  -H "X-API-Key: vyo_YOUR_KEY" \
  -d '{"collection":"0x...","tokenId":"1","price":"1000000000000000000","signature":"0x...","offer":[...],"consideration":[...]}'
Browser (JavaScript)
// Create order client-side with seaport-js
const order = await seaport.createOrder({...});
const res = await fetch("/api/v1/list", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": "vyo_YOUR_KEY"
  },
  body: JSON.stringify(order)
});

Profiles

GET/profiles/:wallet

Get user profile

Terminal
curl https://nft.vyochain.com/profiles/0xWALLET
Browser (JavaScript)
const res = await fetch("/profiles/" + wallet);
const { displayName, bio } = await res.json();
PUT/profiles/:wallet

Update profile (requires wallet signature)

Terminal
curl -X PUT https://nft.vyochain.com/profiles/0xWALLET \
  -H "Content-Type: application/json" \
  -d '{"displayName":"Alice","bio":"Collector","message":"Update...","signature":"0x..."}'
Browser (JavaScript)
const msg = "Update VALYGO NFT profile for " + address;
const sig = await signer.signMessage(msg);
await fetch("/profiles/" + address, {
  method: "PUT",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ displayName: "Alice", message: msg, signature: sig })
});

Pricing

GET/pricing/rate

Get VYO/USD exchange rate

Terminal
curl https://nft.vyochain.com/pricing/rate
Browser (JavaScript)
const res = await fetch("/pricing/rate");
const { rate, formatted } = await res.json();
// rate = 5.01, formatted = "$5.01"