Docs

Integrate FeatherBot's API into your applications

terminal Base URL

https://api.featherbot.xyz

code Manage Monitors

POST /accounts

Add a Twitter account to monitoring.


// Request Body
{
  "username": "elonmusk"
}
        

// Example using fetch
const response = await fetch('https://api.featherbot.xyz/accounts', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'your-api-key'
  },
  body: JSON.stringify({
    username: 'elonmusk'
  })
});
const data = await response.json();
        
GET /accounts

List all monitored Twitter accounts.


// Example using fetch
const response = await fetch('https://api.featherbot.xyz/accounts', {
  headers: {
    'x-api-key': 'your-api-key'
  }
});
const accounts = await response.json();
        
DELETE /accounts/:account_id

Remove a monitored Twitter account by ID.


// Example using fetch
const accountId = 'abc123';
const response = await fetch(`https://api.featherbot.xyz/accounts/${accountId}`, {
  method: 'DELETE',
  headers: {
    'x-api-key': 'your-api-key'
  }
});
const result = await response.json();
        

wifi WebSocket Connection

wss://api.featherbot.xyz/ws?api_key=your-api-key

Connect to receive real-time updates from monitored accounts.


// Example WebSocket connection
const ws = new WebSocket('wss://api.featherbot.xyz/ws?api_key=your-api-key');

ws.onopen = () => {
  console.log('Connected to FeatherBot WebSocket');
};

ws.onmessage = (event) => {
  const update = JSON.parse(event.data);
  console.log('Received update:', update);
};

ws.onerror = (error) => {
  console.error('WebSocket error:', error);
};

ws.onclose = () => {
  console.log('Disconnected from WebSocket');
};