Download the PHP package stitch-digital/nametodomain-php-sdk without Composer

On this page you can find all versions of the php package stitch-digital/nametodomain-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nametodomain-php-sdk

Name To Domain PHP SDK

Latest Version on Packagist Total Downloads

This package is the official PHP SDK for the Name To Domain API, built with Saloon v3.

Behind the scenes, the SDK uses Saloon to make the HTTP requests.

Installation

To get started, we highly recommend reading the Name To Domain API documentation.

Quick Start

Usage

To authenticate, you'll need an API token. You can create one in the API Dashboard at Name To Domain.

Setting a timeout

By default, the SDK waits 10 seconds for a response. Override via the constructor (apiToken, baseUrl, requestTimeout):

Handling errors

The SDK will throw an exception if the API returns an error. For validation errors, the SDK will throw a ValidationException.

For all other errors, the SDK will throw a \NameToDomain\PhpSdk\Exceptions\NameToDomainException.

Resolve

The resolve endpoint allows you to resolve a single company name to its official website domain with a confidence score.

Resolve a company

You can use the resolve method to resolve a company name and country code to its domain.

The response includes the original input and the resolution result. If no reliable match is found, the domain and confidence will be null.

Resolve with emails

You can optionally pass email addresses for disambiguation:

Domain enrichment

Domain enrichment runs asynchronously and returns richer data (favicon, trust signals, web metadata, company classification, email provider hints, etc.). There are single-company and batch flows.

Enrich a single company

Create an enrichment job for one company. Poll enrichJob(jobId) for the result.

Enrich a single company with idempotency key

You can include an idempotency key to safely retry requests:

Enrich multiple companies (batch)

Create a batch enrichment job. Each item may include company, country, and optionally emails and identifier.

Enrich batch with idempotency key

Get a single enrich job

Use enrichJob to get a single-company enrichment job. The output field is only present when the job is completed.

Get a batch enrich job

Use enrichBatchJob to get a batch job with one page of output and pagination (when completed):

Get batch enrich job items (paginated)

The enrichBatchJobItems method returns a Saloon Paginator over all JobItem DTOs across pages.

Iterating over items

Using Laravel Collections

Custom pagination

Job item structure

Each JobItem includes:

The result array can contain company_normalized, domain, confidence, and for enrichment: favicon_url, trust, web_metadata, company_classification, email_provider_hints.

Pagination

The SDK uses Saloon's pagination plugin. The enrichBatchJobItems() method returns a Paginator that yields JobItem DTOs across pages. See Saloon pagination documentation for items(), collect(), and advanced usage.

Using Saloon requests directly

You can use the request classes directly for full control:

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of nametodomain-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
saloonphp/pagination-plugin Version ^2.2
saloonphp/saloon Version ^3.14
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stitch-digital/nametodomain-php-sdk contains the following files

Loading the files please wait ...