
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
note-api-client
Advanced tools
A comprehensive Node.js and TypeScript client library for note.com API - Search notes, manage content, handle authentication, and automate your note.com workflow with full TypeScript support
note-api-client is a comprehensive Node.js and TypeScript library for interacting with the note.com API. Build powerful integrations, automate content management, and access note.com's rich features programmatically with ease.
Install via npm:
npm install note-api-client
Install via yarn:
yarn add note-api-client
Install via pnpm:
pnpm add note-api-client
import { NoteAPIClient } from "note-api-client";
// Initialize the client
const client = new NoteAPIClient();
// Search notes by keyword
const notes = await client.searchNotesByKeyword({
phrase: "JavaScript",
});
// Get user's notes
const userNotes = await client.searchNotesByUsername({
username: "your_username",
});
// Get note details
const noteDetail = await client.getNoteDetail({
noteKey: "note_key_here",
});
const notes = await client.searchNotesByKeyword({
phrase: "AI technology",
page: 1,
});
const userNotes = await client.searchNotesByUsername({
username: "example_user",
page: 1,
});
const categoryNotes = await client.searchNotesByCategory({
categoryName: "tech",
page: 1,
});
const hashtagNotes = await client.searchNotesByHashtag({
hashtag: "programming",
page: 1,
});
const newNote = await client.createNote({
title: "My First Note",
body: "<p>This is the content of my note.</p>",
});
const published = await client.editNote({
id: "123456",
title: "Updated Title",
body: "<p>Updated content</p>",
eyecatchImageKey: "optional_image_key", // optional
index: true, // optional: enable table of contents
});
const draft = await client.saveDraft({
id: "123456",
title: "Draft Title",
body: "<p>Draft content</p>",
isTempSaved: false, // optional (default: true)
index: true, // optional: enable table of contents
});
await client.deleteNote({ id: "123456" });
await client.draftDelete({ id: "123456" });
The recommended flow to create and publish a note:
// 1. Sign in
await client.signIn({
login: "your_email@example.com",
password: "your_password",
g_recaptcha_response: "",
redirect_path: "/",
});
// 2. Create a draft
const created = await client.createNote({
title: "My Article",
body: "",
});
// 3. Save draft with content
await client.saveDraft({
id: created.id.toString(),
title: "My Article",
body: "<p>Article content here</p>",
isTempSaved: false,
index: false,
});
// 4. Publish
await client.editNote({
id: created.id.toString(),
title: "My Article",
body: "<p>Article content here</p>",
});
To add a table of contents that auto-generates links from headings, use the <table-of-contents> tag and set index: true in both saveDraft and editNote.
| Tag | Description | Appears in TOC? |
|---|---|---|
<table-of-contents> | Table of contents block | — |
<h2> | Large heading | Yes |
<h3> | Small heading | No |
<p> | Paragraph | No |
<ul>, <ol>, <li> | Lists | No |
<blockquote> | Quote | No |
<pre><code> | Code block | No |
<figure>, <img> | Image | No |
<hr> | Horizontal rule | No |
<strong>, <em>, <a>, <br> | Inline formatting | No |
Note:
<table>HTML tags are not supported and will be stripped by note.com.
Every element should have a unique name and id attribute (UUID v4):
import crypto from "crypto";
const uuid = () => crypto.randomUUID();
const body = [
// Table of contents (place before headings)
`<table-of-contents name="${uuid()}" id="${uuid()}"><br></table-of-contents>`,
// Headings & content
`<h2 name="${uuid()}" id="${uuid()}">Introduction</h2>`,
`<p name="${uuid()}" id="${uuid()}">First paragraph.</p>`,
`<h2 name="${uuid()}" id="${uuid()}">Main Topic</h2>`,
`<p name="${uuid()}" id="${uuid()}">Second paragraph.</p>`,
`<h3 name="${uuid()}" id="${uuid()}">Sub Topic</h3>`,
`<p name="${uuid()}" id="${uuid()}">Details here.</p>`,
`<h2 name="${uuid()}" id="${uuid()}">Conclusion</h2>`,
`<p name="${uuid()}" id="${uuid()}">Summary.</p>`,
].join("");
// 1. Create draft
const created = await client.createNote({ title: "My Article", body: "" });
// 2. Save draft with index: true
await client.saveDraft({
id: created.id.toString(),
title: "My Article",
body: body, // HTML with <table-of-contents> and <h2> tags
isTempSaved: false,
index: true, // Required for TOC
});
// 3. Publish with index: true
await client.editNote({
id: created.id.toString(),
title: "My Article",
body: body,
index: true, // Required for TOC
});
const users = await client.searchUsersByKeyword({
phrase: "developer",
page: 1,
});
const user = await client.searchUserByUsername({
username: "example_user",
});
const followers = await client.getFollowers({
username: "example_user",
page: 1,
});
const followings = await client.getFollowings({
username: "example_user",
page: 1,
});
const magazines = await client.searchMagazinesByKeyword({
phrase: "technology",
page: 1,
});
const magazine = await client.getMagazineDetail({
magazineKey: "magazine_key_here",
});
const hashtags = await client.getHashtags();
const hashtagDetail = await client.getHashtagDetail({
hashtag: "nodejs",
});
const categories = await client.getCategories();
const session = await client.signIn({
login: "your_email@example.com",
password: "your_password",
g_recaptcha_response: "",
redirect_path: "/",
});
const eyecatch = await client.uploadEyecatch({
imageData: buffer,
filename: "image.jpg",
});
const comments = await client.getComments({
noteKey: "note_key_here",
page: 1,
});
const recommendations = await client.getRecommendMetadata();
const layouts = await client.getMkitLayouts();
const contests = await client.getContests();
const client = new NoteAPIClient("your_session_cookies_here");
// Now you can perform authenticated operations
const note = await client.createNote({
title: "Authenticated Note",
body: "This note is created with authentication.",
});
try {
const notes = await client.searchNotesByKeyword({ phrase: "test" });
console.log(notes);
} catch (error) {
console.error("Error fetching notes:", error);
}
Contributions are welcome! We appreciate your help in making this library better.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)Please read our Contributing Guidelines for more details.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
If you find this library useful, please consider giving it a ⭐ on GitHub!
For questions, suggestions, or feedback, please open an issue on GitHub.
FAQs
A comprehensive Node.js and TypeScript client library for note.com API - Search notes, manage content, handle authentication, and automate your note.com workflow with full TypeScript support
We found that note-api-client 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.