
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
Node.js client library for Zaim API
npm i node-zaim
If you already have an access token, you can initialize the client directly:
import { Zaim } from 'node-zaim';
const zaim = new Zaim({
consumerKey: 'your-consumer-key',
consumerSecret: 'your-consumer-secret',
accessToken: 'your-access-token',
accessTokenSecret: 'your-access-token-secret',
});
If you need to obtain an access token via OAuth, use the following flow:
import Zaim from 'node-zaim';
const zaim = new Zaim({
consumerKey: 'your-consumer-key',
consumerSecret: 'your-consumer-secret',
});
// 1. Get a request token
const { token, tokenSecret } = await zaim.getRequestToken();
// 2. Redirect the user to the authorization URL
const authorizeUrl = zaim.getAuthorizeUrl(token);
console.log('Redirect user to:', authorizeUrl);
// 3. After the user authorizes, exchange for an access token
// using the oauth_verifier from the callback
const { accessToken, accessTokenSecret } = await zaim.getAccessToken(
token,
tokenSecret,
'oauth-verifier-from-callback'
);
// 4. Store the access token for future use
console.log('Access Token:', accessToken);
console.log('Access Token Secret:', accessTokenSecret);
You can also set the access token later on an existing instance:
zaim.setAccessToken(accessToken, accessTokenSecret);
verify()Representation of the requesting user if authentication was successful.
const user = await zaim.user.verify();
console.log(user.name); // 'MyName'
console.log(user.inputCount); // 100
console.log(user.currencyCode); // 'JPY'
list()Showing the list of input data
// Get all records
const allMoney = await zaim.money.list();
console.log(allMoney[0].amount); // 10000
console.log(allMoney[0].mode); // 'income'
// Filter by date range and type
const payments = await zaim.money.list({
mode: 'payment',
startDate: '2024-01-01',
endDate: '2024-12-31',
limit: 50,
});
create()Input payment data
const payment = await zaim.payment.create({
categoryId: 101,
genreId: 10101,
amount: 1,
date: '2026-02-04',
comment: 'test',
name: 'test',
place: 'test',
});
console.log(payment);
update()Update payment data
const payment = await zaim.payment.update({
amount: 1,
date: '2026-02-04',
genreId: 10101,
categoryId: 101,
placeUid: 'zm-12345',
comment: 'test',
});
console.log(payment);
delete()Delete payment data
const payment = await zaim.payment.delete(11820767);
console.log(payment);
create()Input income data
const income = await zaim.income.create({
categoryId: 101,
amount: 1,
date: '2026-02-04',
place: 'test',
comment: 'test',
});
console.log(income);
update()Update income data
const income = await zaim.income.update({
categoryId: 101,
amount: 1,
date: '2026-02-04',
placeUid: 'zm-12345',
comment: 'test',
});
console.log(income);
delete()Delete income data
const income = await zaim.income.delete(11820767);
console.log(income);
create()Input transfer data
const transfer = await zaim.transfer.create({
amount: 1,
date: '2026-02-04',
fromAccountId: 1,
toAccountId: 1,
comment: 'test',
});
console.log(transfer);
update()Update transfer data
const transfer = await zaim.transfer.update({
amount: 1,
date: '2026-02-04',
comment: 'test',
});
console.log(transfer);
delete()Delete transfer data
const transfer = await zaim.transfer.delete(11820767);
console.log(transfer);
list()Showing the list of your categories
const categories = await zaim.category.list();
console.log(categories[0].name); // 'Food'
default()Get default category list
const categories = await zaim.category.default('en');
console.log(categories[0].name); // 'Food'
list()Showing the list of your genres
const genres = await zaim.genre.list();
console.log(genres[0].name); // 'Geocery'
default()Get default genre list
const genres = await zaim.genre.default('en');
console.log(genres[0].name); // 'Geocery'
list()Showing the list of your accounts
const accounts = await zaim.account.list();
console.log(accounts[0].name); // 'Credit card'
default()Get default account list
const accounts = await zaim.account.default('en');
console.log(accounts[0].name); // 'Wallet'
list()const currencies = await zaim.currency.list();
console.log(currencies[0].currencyCode); // 'AUD'
console.log(currencies[0].name); // 'Australian dollar'
| Endpoint | Method | Description |
|---|---|---|
zaim.user.verify() | GET | Representation of the requesting user if authentication was successful |
zaim.money.list(params?) | GET | Showing the list of input data |
zaim.payment.create(params) | POST | Input payment data |
zaim.payment.update(id, params) | PUT | Update payment data |
zaim.payment.delete(id) | DELETE | Delete payment data |
zaim.income.create(params) | POST | Input income data |
zaim.income.update(id, params) | PUT | Update income data |
zaim.income.delete(id) | DELETE | Delete income data |
zaim.transfer.create(params) | POST | Input transfer data |
zaim.transfer.update(id, params) | PUT | Update transfer data |
zaim.transfer.delete(id) | DELETE | Delete transfer data |
zaim.category.list() | GET | Showing the list of your categories |
zaim.genre.list() | GET | Showing the list of your genres |
zaim.account.list() | GET | Showing the list of your accounts |
zaim.account.default(lang?) | GET | List default accounts |
zaim.category.default(lang?) | GET | List default categories |
zaim.genre.default(lang?) | GET | List default genres |
zaim.currency.list() | GET | List available currencies |
For full details on each endpoint, refer to the Zaim API documentation.
Please see CONTRIBUTING.md for contribution guidelines.
MIT
FAQs
Node.js client library for Zaim API
We found that node-zaim demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.