Welcome to Veryfi’s PHP SDK. This module provides helper functions to build AI-powered document processing tools that extract and enrich data into structured JSON—reducing manual entry, accelerating workflows, and improving accuracy.
This guide assumes you have Veryfi portal credentials (free to sign up) and basic PHP coding experience. If you’re new to Veryfi, check out our About us page.
Not sure what to build? Here are some ideas to get you started solving real-world problems.
TL;DR
- Free Signup to get API Keys: https://app.veryfi.com/auth/register/
- Free SDK download from Public Repo: https://github.com/veryfi/veryfi-php
- API Docs: https://docs.veryfi.com/ (or use any LLM which are trained on our API doc)
- Have fun! Email us ([email protected]) if you run into issues or need inspiration.
Installation
In your project root run
composer require veryfi/veryfi-php
Getting Started
Obtaining Client ID and user keys
If you don’t have an account with Veryfi, please go ahead and register here: https://hub.veryfi.com/signup/api/

Below is the sample script using Veryfi to OCR and extract data from a document:
How to use it?
// First, include the autoload file generated by Composer require_once "path_to_your_vendor_autoload"; // Then use the Veryfi API use veryfi\Client;
Process a document
$client_id = 'your_client_id';
$client_secret = 'your_client_secret';
$username = 'your_username';
$api_key = 'your_api_key';
$veryfi_client = new Client($client_id, $client_secret, $username, $api_key);
$categories = array('Advertising & Marketing', 'Automotive');
$file = 'path_to_your_image';
$return_associative = true;
$delete_after_processing = false;
$json_response = json_decode($veryfi_client->process_document($file, $categories, $delete_after_processing), $return_associative);
Update a document
$client_id = 'your_client_id';
$client_secret = 'your_client_secret';
$username = 'your_username';
$api_key = 'your_api_key';
$veryfi_client = new Client($client_id, $client_secret, $username, $api_key);
$document_id = 'your_document_id' //as int
$parameters = array('category' => 'Meals & Entertainment',
'total' => 11.23);
$return_associative = true;
$json_response = json_decode($veryfi_client->update_document($document_id, $parameters), $return_associative);
Need help?
Visit Veryfi’s Universal Search which searches across our API Docs, FAQ pages, YouTube guides and tutorials. If you run into any issue or need help installing or using this library, please contact our amazing technical account management team via [email protected].
Found a bug in our SDK? If you found a bug in this library or would like new features added, then open an issue or pull requests against this open source repo.
For fun
Just for fun and for making this far here’s a brief history about our wonderful PHP language.
PHP has a fascinating evolution from a simple set of tools to one of the web’s most widely-used server-side languages.
PHP began in 1994 when Rasmus Lerdorf created “Personal Home Page Tools” – a set of Common Gateway Interface (CGI) scripts written in C to maintain his personal homepage. He released the source code publicly in 1995 as “Personal Home Page/Forms Interpreter” (PHP/FI), which allowed other developers to use it for building dynamic web applications and processing form data.
In 1997, two Israeli developers, Zeev Suraski and Andi Gutmans, rewrote PHP’s parser to create PHP 3, which was released in 1998. This version was the first to resemble modern PHP and gained significant adoption. The name also changed to the recursive acronym “PHP: Hypertext Preprocessor” at this point.
The same duo then created the Zend Engine in 1999, which powered PHP 4 (released in 2000). This brought major performance improvements and support for more web servers. PHP 4 solidified PHP’s position as a major force in web development during the early 2000s.
PHP 5 arrived in 2004 with the Zend Engine 2, introducing a much-improved object-oriented programming model, better MySQL support through MySQLi, and features like PDO for database abstraction. This version lasted over a decade with incremental updates.
PHP 7, released in 2015, was a game-changer with massive performance improvements (often 2x faster than PHP 5.6) thanks to the new Zend Engine 3. PHP 8, released in 2020, added JIT compilation and features like union types and named arguments.
Today, PHP powers a substantial portion of the web, including platforms like WordPress, and continues to evolve with modern language features.