domainr-node
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

💻 domainr-node

domainr-node is a Domainr API client written for Node that fully supports both the standard and enterprise versions.

Installation

Using npm:

npm install domainr-node

Using yarn:

yarn add domainr-node

Usage

First of all, an API key must be generated. This can be done here.

domainr-client is based entirely on an asynchronous Promise API.

const { DomainrClient } = require("domainr-node");
// alternatively, with modern ES syntax
import { DomainrClient } from "domainr-node";

const client = new DomainrClient("YOUR-API-KEY", {
	// OPTIONAL
	endpoint: "standard", // Use "enterprise" if you have an API key for the high volume API
});

search

await client.search("pizzashop");
/** => RETURNS
    [
    {
        domain: 'pizza.shop',
        host: '',
        subdomain: 'pizza.',
        zone: 'shop',
        path: '',
        registerURL: 'https://api.domainr.com/v2/register?client_id=mashape-XXX&domain=pizza.shop&gl=de&registrar=&source='
    },
    {
        domain: 'pizza.shopping',
        host: '',
        subdomain: 'pizza.',
        zone: 'shopping',
        path: '',
        registerURL: 'https://api.domainr.com/v2/register?client_id=mashape-XXX&domain=pizza.shopping&gl=de&registrar=&source='
    },
    {
        domain: 'pizza.store',
        host: '',
        subdomain: 'pizza.',
        zone: 'store',
        path: '',
        registerURL: 'https://api.domainr.com/v2/register?client_id=mashape-XXX&domain=pizza.store&gl=de&registrar=&source='
    },
    ...
  ]
*/

status

await client.status("pizzashop.com");
// => [ { domain: 'pizzashop.com', zone: 'com', status: [ 'active' ] } ]

await client.status("JustSomeRandomDomainName.com");
/* => RETURNS
[
  {
    domain: 'JustSomeRandomDomainName.com',
    zone: 'com',
    status: [ 'undelegated', 'inactive' ]
  }
]
*/

register

await client.register("JustSomeRandomDomainName.com");
// => https://iwantmyname.com/partner/search?r=domai.nr&u=XXXXXX&b=XXXXXXX&q=JustSomeRandomDomainName.com

LICENSE

Copyright (C) 2021 Marvin Schopf

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package Sidebar

Install

npm i domainr-node

Weekly Downloads

1

Version

1.0.3

License

Apache-2.0

Unpacked Size

29.9 kB

Total Files

9

Last publish

Collaborators

  • marvman