Example app

A complete program that reads your inquiries and domains through the Parking API.
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship

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

  • get sends one request with your token in the Authorization header, and a User-Agent that names your program. An error (e.g., a wrong token) stops the program with the status and the message.
  • every follows the pages of a list: it asks for 100 rows at a time and stops at last_page in the pagination block.
  • GET parking/inquiries with unread=1 gives the inquiries you have not opened yet.
  • GET parking/domains-settings gives every verified domain with its settings. A bin_price of -1 means 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.
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back