PHPackages                             docparser/docparser-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. docparser/docparser-php

ActiveLibrary[API Development](/categories/api)

docparser/docparser-php
=======================

Docparser API PHP Client

1.2.0(1y ago)669.4k↓36.1%10[1 issues](https://github.com/Docparser/Docparser-PHP/issues)[1 PRs](https://github.com/Docparser/Docparser-PHP/pulls)MITPHP

Since Nov 10Pushed 1y ago4 watchersCompare

[ Source](https://github.com/Docparser/Docparser-PHP)[ Packagist](https://packagist.org/packages/docparser/docparser-php)[ RSS](/packages/docparser-docparser-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (6)Used By (0)

[![](https://camo.githubusercontent.com/18bc1c649629f670698ecb9ca6a67b528d5a9bc457451bac14d4514ad985e0c9/68747470733a2f2f646f637061727365722e636f6d2f696d672f6c6f676f2e706e67)](https://docparser.com "Extract Data From PDF")

Official Docparser API PHP Client
---------------------------------

[](#official-docparser-api-php-client)

`docparser-php` provides convenient PHP bindings for the [Docparser API](https://dev.docparser.com).

---

**[Documentation](#documentation)**| **[Installation](#installation)**| **[Configuration](#configuration)**| **[Usage](#usage)**| **[Contributing](#contributing)**| **[License](#license)**| **[Changelog](#changelog)**

---

Documentation
-------------

[](#documentation)

For a generic description of the Docparser API, please see our developer documentation [here](https://dev.docparser.com/). Our developer documentation lists all available API methods with their parameters and expected responses.

Installation
------------

[](#installation)

This library requires php 5.5 or above.

**Using Composer**:

```
composer require docparser/docparser-php
```

or in `composer.json`:

```
{
    "require": {
        "docparser/docparser-php": "1.*"
    }
}
```

Configuration
-------------

[](#configuration)

Create a Docparser PHP Client by using your Docparser API Token:

```
require('./vendor/autoload.php');

use Docparser\Docparser;
$docparser = new Docparser("APITOKEN");
```

### Test Your Authentication

[](#test-your-authentication)

You can call our `ping()` method to test your API key. The method retuns a boolean value which indicates if a connection to our API could be established and that the API key is working.

```
echo $docparser->ping();
```

Usage
-----

[](#usage)

### [Document Parsers](https://dev.docparser.com/#parsers)

[](#document-parsers)

**List All Document Parsers**

Returns a list of the document parsers created in your account.

```
$docparser->getParsers();
```

### [Documents](https://dev.docparser.com/#documents)

[](#documents)

The Docparser PHP SDK offers three different methods for importing your document.

All import methods allow you to pass a `$remoteId` with your document. The remote ID can be any arbitrary string with a maximum length of 255 characters. The submitted value will be kept throughout the processing and will be available later once you obtain the parsed data with our API or through Webhooks.

**Upload Document From Local File System**

Reads a file from your local filesystem and uploads it to your document parser.

```
$docparser->uploadDocumentByPath($parserId, $filePath, $remoteId = null);
```

**Upload Document By Providing File Content**

This method creates a new document in your document parser based on the raw file content or a file pointer. Additionally, a file name can be provided.

```
$docparser->uploadDocumentByContents($parserId, $file, $remoteId = null, $filename = null);
```

**Fetch Document From An URL**

Imports a document from a publicly available HTTP(S) URL.

```
$docparser->fetchDocumentFromURL($parserId, $url, $remoteId = null);
```

### [Parsed Data](https://dev.docparser.com/#parsed-data)

[](#parsed-data)

The Docparser API allows you to retrieve the extracted document data. You can either list the data of multiple documents or get the data of a specific document.

Both methods used for retrieving parsed data allow you to specify the "format" parameter - this allows you to choose between a flat structure and a nested array structure. For most implementations, leaving it as "object" will serve you fine.

> Please note: Polling the API for new results is not the recommended way of obtaining your data. A much better way than polling our API for parsed data is to use [Webhooks](https://docparser.com/integration/webhooks). By using webhooks, parsed data will be pushed to your API immediately after parsing.

**Get Data Of One Document**

Fetches the parsed data for a specific document by providing a `$parserId` and the `$documentId`. The `$documentId` is the Docparser Document ID which is returned when importing a document through the API.

```
$docparser->getResultsByDocument($parserId, $documentId, $format = 'object');
```

**Get Data Of Multiple Documents**

Fetches the results of multiple documents parsed by a specific document parser. This function allows you granular filtering and ordering of the results. Please see our [documentation](https://dev.docparser.com/?shell#get-multiple-data-sets) for the list of available parameters.

```
$docparser->getResultsByParser($parserId, $options = []);
```

Contributing
------------

[](#contributing)

Bug reports and pull requests are welcome on [GitHub](https://github.com/docparser/docparser-php).

Please follow [PSR-2](http://www.php-fig.org/psr/psr-2/) with your contributions and also take care of any changed / newly needed [phpDoc](https://phpdoc.org/) comments.

License
-------

[](#license)

The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

### The MIT License (MIT)

[](#the-mit-license-mit)

*Copyright (c) 2016 DAUSINGER DIGITAL EURL.*

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Changelog
---------

[](#changelog)

- 11/10/2017 initial release

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance41

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~889 days

Total

4

Last Release

442d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/139f134c79d5fe290a95f141aa71b4512954b23f29ecacb92bea35f25a0fe2ff?d=identicon)[docparser](/maintainers/docparser)

---

Top Contributors

[![chezmo](https://avatars.githubusercontent.com/u/1691948?v=4)](https://github.com/chezmo "chezmo (8 commits)")[![docparser-dev](https://avatars.githubusercontent.com/u/33521308?v=4)](https://github.com/docparser-dev "docparser-dev (3 commits)")[![travisbeale](https://avatars.githubusercontent.com/u/9825648?v=4)](https://github.com/travisbeale "travisbeale (3 commits)")[![ziming](https://avatars.githubusercontent.com/u/679513?v=4)](https://github.com/ziming "ziming (1 commits)")[![rjhllr](https://avatars.githubusercontent.com/u/6401945?v=4)](https://github.com/rjhllr "rjhllr (1 commits)")[![marioyuwonossc](https://avatars.githubusercontent.com/u/134291504?v=4)](https://github.com/marioyuwonossc "marioyuwonossc (1 commits)")[![Syrok](https://avatars.githubusercontent.com/u/124498?v=4)](https://github.com/Syrok "Syrok (1 commits)")

### Embed Badge

![Health badge](/badges/docparser-docparser-php/health.svg)

```
[![Health](https://phpackages.com/badges/docparser-docparser-php/health.svg)](https://phpackages.com/packages/docparser-docparser-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
