/monthly-summary API Call
← file format | how-to's | how to calculate aggregated monthly dividend totals | dividend tracker api documentation
/monthly-summary API call
Create the script making the /monthly-summary API call
- Navigate to the root folder where you forked the Dividend Tracker API repo
- Create a file and give it a meaningful name like
test-monthly-dividends.js - Paste the code below in the file you've just created and save it.
const axios = require('axios');
axios.post('http://localhost:3000/monthly-summary', [
{ ticker: 'AAPL', paymentDate: '2025-06-30', amount: 2.43 },
{ ticker: 'AMZN', paymentDate: '2025-07-01', amount: 1.89 },
{ ticker: 'GOOGL' , paymentDate: '2025-07-15', amount: 0.75 },
{ ticker: 'AAPL', paymentDate: '2025-07-30', amount: 0.26 },
])
.then(res => console.log(res.data))
.catch(err => console.error(err));
Run the Script
After saving the test-monthly-dividends.js above, you must run the script using the node command to make the API call.
node test-monthly-dividends.js
Output from /monthly-summary API call
Upon success, you'll receive aggregated data similar to below (JSON format) printed to your console:
{
"2025-06": 2.43,
"2025-07": 2.90
}