Download the PHP package optimaize/nameapi-client-php without Composer

On this page you can find all versions of the php package optimaize/nameapi-client-php. 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 nameapi-client-php

nameapi-client-php

PHP Client for the NameAPI Web Service at http://www.nameapi.org/

All you need to send requests is your own api key, get it from nameapi.org.

Library setup

The recommended way is to use Composer. The project at https://github.com/optimaize/nameapi-client-php-example-composer shows how that's done.

You can download the source code and make it available to your code. Or you can check it out directly from this GitHub project. Currently there is no phar available.

The only requirement is that the php_curl extension is enabled.

Functional tests

Functional tests that demonstrate how the services work, and that they work, are in https://github.com/optimaize/nameapi-client-php-functionaltests you can look at the code, and you can even run those tests using your api key and PHPUnit.

Setup code

At first you need one single include, the one to the nameapi service factory:

Then you need a Context that explains a bit your working environment, something like:

Then you can already create the service factory which gives you access to all nameapi services:

Send a ping

This code sends a simple ping to nameapi to test the connection:

If the response is 'pong' then all is fine and you can move on to the real goodies.

Input / Output

All input objects come with builders or nicely documented setters. The result objects returned by the services all have fully documented getters. Many input arguments are optional - that means you can start simple, and add more as you need.

Behind the scenes this service api uses REST. But luckily you don't need to worry about any of the interface detail, you can just use the provided classes.

Person input object

Most services accept a 'Person' as input. This person contains a name, and optionally more data such as gender, birth date etc. The name can be just a single "full name" string, or it can be composed of multiple fields like given name, middle name, surname. This standardized api makes it simple to use different services in a consistent way, and is very convenient in accepting the data however you have it at hands.

Creating a simple person looks something like this:

Name Parser

Name parsing is the process of splitting a full name into its components.

Using the $inputPerson created earlier:

Name Genderizer

Name genderizing is the process of identifying the gender based on a person's name.

Using the $inputPerson created earlier:

Name Matcher

The Name Matcher compares names and name pairs to discover whether the people could possibly be one and the same person.

This service takes 2 people as input:

Name Formatter

The Name Formatter displays personal names in the desired form. This includes the order as well as upper and lower case writing.

Email Name Parser

The Email Name Parser extracts names out of email addresses.

Disposable Email Address Detector

The DEA-Detector checks email addresses against a list of known "trash domains" such as mailinator.com.

Risk Detector

The Risk-Detector checks all data in the person input, including the name, address, birthdate, email address and phone number for fake and suspicious data.


All versions of nameapi-client-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-curl Version *
ext-json Version *
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 optimaize/nameapi-client-php contains the following files

Loading the files please wait ....