Read trade history
Fetch the user's recent trades from your server using their OAuth access token.
Server side: fetch trade history
js
const response = await fetch('https://api.tradeit.app/api/tool/execute', {
method: 'POST',
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
toolName: 'get_trades',
params: { limit: 20 },
}),
});
if (!response.ok) throw new Error(`Trade history request failed: ${response.status}`);
const history = await response.json();See Get trades for the sample response, pagination, and full API reference.