Build with the AI Skill
Trade ItTrade ItDocs
Actions

Read trade history

Fetch the user's recent trades from your server using their OAuth access token.

Server side: fetch trade history

const response = await fetch('https://api.tradeit.app/api/tool/execute', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${accessToken}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    tool_name: 'get_trades',
    params: { limit: 20 },
  }),
});
if (!response.ok) throw new Error(`Trade history request failed: ${response.status}`);
const history = await response.json();

Returns: a page of Trade[] in trades. See Get trades for a sample response and pagination.

On this page