Download the PHP package glook/dadata-php-sdk without Composer

On this page you can find all versions of the php package glook/dadata-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 dadata-php-sdk

Dadata Php SDK

Typed PHP SDK for Dadata API generated from OpenAPI schemas.

The package exposes two generated clients:

For normal usage, create clients through the package factories instead of wiring HTTP clients and authentication plugins by hand.

Installation

Requirements:

If your application does not already provide a PSR-18 client, install one explicitly:

Authentication

Dadata requires an API token and a secret key.

The factories add both generated authentication plugins automatically:

You only need to pass raw credentials:

HTTP Plugins

Factories accept an optional list of extra Http\Client\Common\Plugin instances. Authentication is always registered first, then your plugins are appended.

This is the recommended extension point for retries, logging, caching, tracing, rate limiting, custom headers, and framework-specific integrations.

Fetch Modes

Generated methods return typed model objects by default:

To get the raw PSR-7 response instead, pass Client::FETCH_RESPONSE:

Suggestions API

Create a Suggestions client:

Suggest Address

Suggest Address in English

Find Address by FIAS or KLADR ID

Reverse Geocode Address

Find Company by INN

Find by INN and KPP:

Suggest Company

Suggest Bank

Suggest Email

Suggestions Methods

Method Dadata area
suggestAddress(SuggestAddressRequest $request) Address suggestions
suggestParty(SuggestPartyRequest $request) Company suggestions
suggestBank(SuggestBankRequest $request) Bank suggestions
suggestEmail(SuggestRequest $request) Email suggestions
suggestFio(SuggestFioRequest $request) Personal name suggestions
suggestFias(SuggestFiasRequest $request) FIAS suggestions
suggestOutward(string $name, SuggestOutwardRequest $request) Generic suggest endpoint
findByIdAddress(FindAddressByIdRequest $request) Find address by ID
findByIdParty(FindPartyByIdRequest $request) Find company by INN/OGRN
findByIdBank(FindBankByIdRequest $request) Find bank by BIC, SWIFT, INN, or registration number
findByIdFias(FindFiasByIdRequest $request) Find address strictly by FIAS
findByIdDelivery(SuggestRequest $request) Delivery city IDs
findByEmailCompany(SuggestRequest $request) Find company by email
findAffiliatedParty(FindAffiliatedPartyRequest $request) Find affiliated companies
geoLocateAddress(GeoLocateAddressRequest $request) Reverse geocode address
geoLocateOutward(string $name, GeoLocateOutwardRequest $request) Generic geolocate endpoint
ipLocateAddress(IpLocateAddressRequest $request) GeoIP address lookup
findByIdOutward(string $name, SuggestRequest $request) Generic find-by-id endpoint

Cleaner API

Create a Cleaner client:

Clean Address

Cleaner methods accept arrays of strings and return arrays of typed result models.

Clean Name

Clean Phone

Clean Email

Clean Composite Record

Use cleanRecord() when one input row contains multiple fields.

Cleaner Methods

Method Dadata area
cleanAddress(array $values) Address cleansing and geocoding
cleanName(array $values) Personal name cleansing
cleanPhone(array $values) Phone cleansing
cleanEmail(array $values) Email cleansing
cleanBirthdate(array $values) Birthdate cleansing
cleanPassport(array $values) Passport cleansing
cleanVehicle(array $values) Vehicle cleansing
cleanAsIs(array $values) Return values without cleansing
cleanRecord(RecordString $request) Composite record cleansing

Error Handling

Generated methods throw UnexpectedStatusCodeException when Dadata returns an unexpected HTTP status code.

For Cleaner API imports, use Glook\Dadata\Generated\Clear\Exception\UnexpectedStatusCodeException.

Project Structure

Development

Install dependencies:

Run checks:

Run unit tests:

Regenerate clients from schemas:

Generate only one client:

After generation, review generated code and commit it together with schema/config changes.

License

MIT


All versions of dadata-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-json Version *
jane-php/open-api-runtime Version ^6.3 || ^7.0
symfony/serializer Version ^4.4 || ^5.0 || ^6.0
nyholm/psr7 Version ^1.8
psr/http-client Version ^1.0
psr/http-message Version ^1.0
psr/http-factory Version ^1.0
php-http/discovery Version ^1.14
php-http/client-common Version ^2.0
php-http/httplug Version ^2.0
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 glook/dadata-php-sdk contains the following files

Loading the files please wait ...