CARV
CARVPlayPortalProtocol
  • Overview
    • Introducing CARV
  • SVM - AI AGENTIC CHAIN
    • Introduction
      • Architecture
      • AI Agent in TEE environment
      • CARV Verifier Nodes
    • Quick Start
      • Bridge Token
      • Explorer
      • Command line tool
      • Reading from CARV SVM Network
      • Writing to the Network
      • Network Info
  • D.A.T.A. - AI FRAMEWORK
    • Introduction
      • DeepSeek Integration
      • D.A.T.A's Core Features
      • How It Empowers AI Agents
      • Driving the Future of AI and Blockchain
      • Leveraging CARV SVM Chain for Privacy and Trustless Data Sharing
    • Quick Start Guide
    • Architecture
    • ERC-7231 (CARV ID)
    • Examples
      • On-Chain Insights
    • Getting Started
      • D.A.T.A Framework Plugin for Eliza
    • Use Cases and Implementation
      • Getting On-Chain Data for AI Agents
      • What's Coming with the D.A.T.A Framework
    • API Documentation
      • News
      • On-chain Data SQL Query
        • Ethereum Schema
        • Bitcoin Schema
        • Base Schema
        • Solana Schema
      • On-chain Data SQL Query by LLM
      • Token Info and Price
      • User Balance by Twitter ID
      • User Balance by Discord ID
  • CARV Ecosystem
    • CARV Play
      • Portal Access
      • Integration Guide
        • .Play Name Service Integration
        • API-Verified Quest (RESTFUL)
        • API-Verified Quest (GraphQL)
        • CARV ID OAuth 2.0
        • CARV ID Telegram SDK
      • Smart Contracts & Security
    • MOFF Bot & Customer Data Platform
    • CARV Account
      • ERC 7231
    • Verifier Nodes
      • How to Purchase Nodes
      • Buyback Program
      • Why Verifier Nodes
      • How do Verifier Nodes Work
        • CARV/veCARV Token
        • CARV Vault
        • CARV NFT License
        • CARV Protocol Service
        • Trusted Execution Environment (TEE)
        • Verifier Node
        • Attestation
        • Delegation
        • Rewards
        • SGX Attestation Verification
      • Verifier Node Sale Dynamics
      • Smart Contract Addresses
      • License Key (NFT)
      • Delegation
      • Node Rewards
      • Join Mainnet Verifier Nodes
        • Prerequisites
        • Delegation Tutorial
        • Operating a Verifier Node
          • Running in VPS
          • Running in CLI
            • Using Source Code
            • Using Docker
            • Gasless Server API
          • Running in Desktop App
      • Explorer
      • FAQ
        • Node Sale
        • Node Operation
  • CARV LABS
    • Introduction
    • Working with CARV Labs
  • Tokenomics
    • Utility
      • veCARV(s)
    • Distribution & Vesting
  • DECENTRALIZED GOVERNANCE
    • ⚔️Universal Guardian Program
    • 📔DAO Governance
    • 🌏Community Programs & Activities
  • Resources
    • 🗜️Writings
    • 🗞️CARV in the News
    • 🫶Social & Community Links
    • 🅰️Brand Guideline
    • 💰Job Openings
Powered by GitBook
On this page
  1. D.A.T.A. - AI FRAMEWORK
  2. API Documentation

User Balance by Twitter ID

This endpoint relies on CARV ID to establish the relationship between the provided Twitter ID and the corresponding blockchain address. If the specified twitter_user_id is not connected to any address through CARV ID, the API will not be able to retrieve the expected result. Ensure that the Twitter account is properly linked to a blockchain address via CARV ID before making a request.

GET UserBalanceByTwitter

Endpoint

GET /ai-agent-backend/user_balance_by_twitter_id

Parameters

Name
Location
Type
Required
Description

twitter_user_id

query

string

no

Twitter handle

chain_name

query

string

no

Blockchain name, e.g., "ethereum"

token_ticker

query

string

no

Token ticker, e.g., "ETH"

Authorization

header

string

yes

Login token in Redis

Description

  • chain_name: Supported values include "ethereum_mainnet", "base_mainnet", "solana_mainnet", "opbnb_mainnet" (and all testnets as well).

Example Request (HTTP)

GET /ai-agent-backend/user_balance_by_twitter_id?twitter_user_id=123456&chain_name=ethereum_testnet&token_ticker=aave
Authorization: <your-auth-token>

Example Request (Shell)

curl -X GET "https://interface.carv.io/ai-agent-backend/user_balance_by_twitter_id" \
-H "Authorization: <your-auth-token>" \
-d "twitter_user_id=123456" \
-d "chain_name=ethereum_mainnet" \
-d "token_ticker=eth"

Example Request (JavaScript)

const fetch = require('node-fetch');

const url = 'https://interface.carv.io/ai-agent-backend/user_balance_by_twitter_id';
const params = new URLSearchParams({
    twitter_user_id: '123456',
    chain_name: 'ethereum_testnet',
    token_ticker: 'eth'
});

const options = {
    method: 'GET',
    headers: {
        'Authorization': '<your-auth-token>'
    }
};

fetch(`${url}?${params.toString()}`, options)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));

4o

Example Response (200 OK)

{
  "code": 0,
  "msg": "Success",
  "data": {
    "balance": "0.010000"
  }
}

Error Response (400):

jsonCopy code{
  "error": "Invalid request"
}

Responses

HTTP Status Code
Meaning
Description
Data Schema

200

none

Inline

400

none

Inline

Response Data Schema

HTTP Status Code 200

Name
Type
Required
Restrictions
Title
Description

code

integer

true

none

Response code

msg

string

true

none

Response message

data

object

true

none

Response data

balance

string

true

none

User balance

HTTP Status Code 400

Name
Type
Required
Restrictions
Title
Description

error

string

true

none

Error description

PreviousToken Info and PriceNextUser Balance by Discord ID

Last updated 3 months ago

OK
Bad Request