SDK PHP
A composer-installable SDK that will allow you to access all ZPK APIs
Installation via composer (recommended)
We recommend using the composer version so that your project can always update to the latest version of the SDK.
Setting up the app
All API calls must specify an application.
The zpkApplication class determines a specific application by its application_id and an authentication api_key.
These applications can be created and managed in the dashboard of your panel.
ZPK Translate
Using the SDK to translate text and detect languages using the ZPK Translate API
Translation
Call the translation API by initializing a translator, in this example you can see a request to translate 2 sentences. In the first case the source language will be autodetected. In the second we indicate the source language.
Getting all llanguages
You can get the entire list of available languages in our translation API.
Keep in mind that this request also has a cost, we recommend caching this data and not performing this query more than once every 48 hours.
Vin Analyzer
Extract and parse Vehicle Identification Numbers (VIN) data, or auto-correct incorrect VIN numbers.
Analyzing VIN numbers
Call the parsing API by initializing a VINS parser
Filtering VINs by zone, country, manufacturer, or brand.
Our API allows you to establish filters that will alter the score of the detected VINs. These filters can be used to exclude VIns that meet one or more criteria, or to give priority to other VINs in case an incorrect number can be corrected to different valid VINs.
In the following example, it will send a VIN with the first three digits VS5 that belongs to the manufacturer 'renault' without establishing any filter. The ZPK API will return the data of a vehicle from the manufacturer renault.
In a second element, we establish a filter that penalizes the renault brand. The API will determine that the VIN sent contains a writing error because we have penalized renault, and will return a Seat brand vehicle because its manufacturer code is VSS, and VSS is optically very similar to VS5
Obtaining countries, manufacturers, and brands.
To get all this data in an updated way you can make the following calls in the SDK.
Keep in mind that these requests also have a cost, we recommend caching this data since it is added and modified only occasionally.
VIN OCR
Extract and parse Vehicle Identification Numbers(VIN) data or auto-correct incorrect VIN numbers from scanned documents and images.
Analyzing an image to extract the VIN
Call the OCR detection API initializing a VIN OCR
Using scoring filters for optimal recognition.
Like the VINAnalyzer API, VINOCR can use filters that will alter the internal scoring of possible VIN numbers considered during optical recognition.
This example will send an image that could match multiple manufacturers:
In this example we will send a VIN number that is missing the first character, and therefore could belong to different manufacturers. For this example we will assume that we work with a fleet of European vehicles.
We will use a filter to give VINs of European vehicles a higher score, forcing the API to give a higher preference score to these vehicles
Getting all considered VINs
You can request the API to return, together with the results, all the VINs that have been taken into account when determining a correct VIN. That can help you create filters specific to your use case.
To do this we will simply call the includeConsideredVins() method
Obtaining manufacturers, brands, and countries.
Your application can query the manufacturers, brands, models and countries that this API can return with a call to different methods.
Keep in mind that consulting this information also has a cost, we recommend caching this data to minimize API calls.
Plate Scanner OCR
Extract vehicle license plates from images and documents
Extracting the license plate from an image
Call the OCR detection API by initializing a License Plate Scanner.
Specifying zones
You can send one or more geographic zones to be used as an API hint at detection time with the setZoneHints method.
Regions in strict mode
With a call to enableStrictRegions() we can force the API to consider only and exclusively license plates from the zones specified above, discarding all license plates that do not comply with the pattern of the specified zones.
Getting all zones
A call to getAllRegions() will return a list of all regions supported by the API. Remember that this request has a cost, we recommend saving this data in cache.
ZPK SMS
Send SMS text messages to mobile phones, supports 216 countries.
Sending a SMS message
Intialize an SmsRequest to send one or more messages.
<?php
$application = new zpkApplication($application_id,$api_key);
$sendRequest = new zpkSmsSendingRequest($application);
$sms = new zpkSMS("+34634568046");
$sms->setFrom("First");
$sms->setMessage("SMS test message, the first one :)");
$sendRequest->add($sms);
$response = $r->send();
var_dump($response);
Checking price rates
Up-to date prices can be requested, initialize a PriceRequest.
<?php
// Initialize zpk application
$application = new zpkApplication($application_id,$api_key);
// Price request
$pRequest = new zpkSmsPriceRequest( $application );
$data = $pRequqest->getPrices();
echo json_encode($data,JSON_PRETTY_PRINT);
ZPK Moderation API
Text message moderation, and source behavior analysis
Analyze messages
<?php
require __DIR__.'/../../vendor/autoload.php';
use zpksystems\phpzpk\zpkApplication;
use zpksystems\phpzpk\zpkModerator;
$application = new zpkApplication('app_id','api_key');
$moderator = new zpkModerator($application);
$moderator->addText( ['text'=>'I want to k**l myself.'] );
echo json_encode($moderator->scan(),
JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
Get statistics from a specific source
<?php
$application = new zpkApplication('app_id','api_key');
$moderator = new zpkModerator($application);
$stats = $moderator->getSourceStats('User-A');
echo json_encode($stats,
JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
echo "END\n";
Pricing
All ZPK System APIs have on-demand pricing, you pay only for the use of the APIs. No monthly fees.
API | Price |
---|---|
Vin OCR |
VinOcr
EUR 0,003 for each scanned image |
Vin Analyzer |
VinAnalyzer
EUR 0,004 for each request
EUR 0,003 for each extra VIN on the request
|
IA Images |
IA Images
Starting at 0,038 €
|
ZPK Translate |
ZPK Translate
First 600.000 characters per month / Free
1 EUR foreach 62.500 additional characters
|
HTML To Image |
HTML To Image
0,0020 for reach capture request.
|
Moderation API |
Moderation API
EUR 0,0010 for moderation (up to 500 characters)
EUR 0,0050 per query to statistics from a message source. |
Plate Scanner |
PlateScanner
EUR 0,001 foreach scanned image
EUR 0,010 for each regions list request
|
ZPK SMS |
ZPK SMS
|
Getting credit
By creating an account at ZPK Systems and validating your data, 2,00 euros will be added free of charge to your account so that you can carry out tests.
Cree una cuenta ahora, y obtenga crédito gratuito para realizar la implementación. Si ya está registrado, acceda a su panel para gestionar su crédito disponible o añadir fondos.
Does your project not use PHP?
Our API can be implemented in a multitude of languages.
If your project does not use PHP you can use the HTTP API. Our APIS work with HTTP communication based on JSON requests and responses. Facilitating implementation in virtually any programming language.
See the http API, endpoints, and parameters in the specific documentation for each API.