This tutorial builds a small program to run each morning: it lists the inquiries you have not read yet, and the verified domains that still have no buy now price. It is written in JavaScript for Node.js 18 or newer, and uses nothing beyond Node.js itself, so there is nothing else to install.
Step 1: Create a token
Under "API access", create a token named "Morning report" with the permissions "View domains" and "View inquiries". The program only reads, so it needs nothing more. Copy the token.
Step 2: Save the program
Save this as morning-report.mjs:
// A morning report from the NamePros Parking API: new inquiries, and
// verified domains that have no buy now price yet. Needs Node.js 18 or newer.
const API = "https://www.namepros.com/api/v1/parking/";
const TOKEN = process.env.NAMEPROS_TOKEN;
// One GET request; returns the decoded JSON answer.
async function get(path, params) {
const response = await fetch(API + path + "?" + new URLSearchParams(params), {
headers: {
Authorization: `Bearer ${TOKEN}`,
"User-Agent": "morning-report/1.0",
},
});
if (!response.ok) {
throw new Error(`${path}: ${response.status} ${await response.text()}`);
}
return response.json();
}
// Every row of a list, page by page.
async function* every(path, key, params = {}) {
for (let page = 1; ; page++) {
const answer = await get(path, { ...params, page, per_page: 100 });
yield* answer[key];
if (page >= answer.pagination.last_page) {
return;
}
}
}
console.log("New inquiries:");
for await (const inquiry of every("inquiries", "inquiries", { unread: 1 })) {
const offer = inquiry.offer ? `${inquiry.offer} ${inquiry.offer_currency}` : "no offer";
console.log(` ${inquiry.domain}: ${inquiry.full_name}, ${offer}`);
}
console.log("Verified domains without a buy now price:");
for await (const row of every("domains-settings", "domains")) {
if (row.settings.bin_price.value === -1) {
console.log(` ${row.domain.name}`);
}
}
Step 3: Run it
Put your token in the NAMEPROS_TOKEN environment variable, then run the program:
export NAMEPROS_TOKEN=npp_your_token node morning-report.mjs
On Windows, use set NAMEPROS_TOKEN=npp_your_token instead of export. The answer looks like this:
New inquiries: lumenpath.io: Priya Natarajan, 7500 USD quietharbor.com: Daniel Reyes, no offer Verified domains without a buy now price: brightorchard.com maplecrestlabs.com
How it works
getsends one request with your token in theAuthorizationheader, and aUser-Agentthat names your program. An error (e.g., a wrong token) stops the program with the status and the message.everyfollows the pages of a list: it asks for 100 rows at a time and stops atlast_pagein thepaginationblock.GET parking/inquirieswithunread=1gives the inquiries you have not opened yet.GET parking/domains-settingsgives every verified domain with its settings. Abin_priceof-1means the domain has no buy now price.
Take it further
- Run it on a schedule (e.g., with cron, or Task Scheduler on Windows) and send the answer to yourself by email.
- Set a price from the program with
POST parking/domain-settings, as in the quick start. The token then also needs "Change domain settings". - Every endpoint and its fields are in the API reference.













