NAV
cURL PHP Python Node.js

Introduction

API Endpoint

https://service.fees.world/API/v1.2/

The feescan API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features which are understood by off-the-shelf HTTP clients. JSON is returned by all API responses, including errors.

Authentication

Example Request:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/api_endpoint_here',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/api_endpoint_here"

payload={}
files={}
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("GET", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request GET 'https://service.fees.world/API/v1.2/api_endpoint_here' \
--header 'x-api-key: api_key_here'
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();

var config = {
  method: 'get',
  url: 'https://service.fees.world/API/v1.2/api_endpoint_here',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Before you can use the feescan API you will need to register in order to recieve an API key.

You authenticate your account by including your secret key in all API requests. Your API key carries privileges to create and manage your orders, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

To use your API key, you need to provide it in an X-API-KEY header with each call.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without a valid API key will also fail.

Responses

HTTP status code summary

Code Meaning
200- OK Everything worked as expected.
400 - Bad Request Your request is invalid.
401 - Unauthorized Authentication Required.
403 - Forbidden Invalid API key or your account has exceeded the maximum number of monthly requests.
404 - Not Found Request not found.
413 - Filesize Too Large You have tried to upload a file that exceeds the maximum file size.
415 - Unsupported Media Type You have tried to upload a file of an unsupported media type.
422 - Unprocessable Entity Semantic error in your request.
500 - Internal Server Error We had a problem with our server. Try again later.
503 - Service Unavailable We're temporarily offline for maintenance. Please try again later.


Example Response:

{
    "Status": 200,
    "ResultStatus": true,
    "ErrorMsg": "Ok",
    "Data": {
        ....
    }
}

feescan uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, etc.). Codes in the 5xx range indicate an error with feescan's servers (these are rare).

Response Attributes

Attribute (type) Description
Status (int) A HTTP status code, from amongst those listed.
ResultStatus (boolean) Whether the call has resulted in a successful repsonse.
ErrorMsg (string) Additional information regarding the error.
Data (object) The returned information for the request made.

Errors

Example Invalid Response:

{
    "Status": 401,
    "ResultStatus": false,
    "ErrorMsg": "Authentication Required",
    "Data": ""
}

If a request is invalid then a code other than 2xx will be given and details about the error will be returned.

API reference

Expenses OCR

Request example (file):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/ocr',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('/Path/To/File/expense.jpg')),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/ocr"

payload={}
files=[
  ('file',('expense.jpg',open('/Path/To/File/expense.jpg','rb'),'image/jpg'))
]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/ocr' \
--header 'x-api-key: api_key_here' \
--form 'file=@"/Path/To/File/expense.jpg"'
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('file', fs.createReadStream('/Path/To/File/expense.jpg'));

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/ocr',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Request example (source):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/ocr',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('source' => 'https://www.yoursite.com/expense.jpg'),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/ocr"

payload={'source': 'https://www.yoursite.com/expense.jpg'}
files=[

]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/ocr' \
--header 'x-api-key: api_key_here' \
--form 'source="https://www.yoursite.com/expense.jpg"'
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('source', 'https://www.yoursite.com/expense.jpg');

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/ocr',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Request example (content):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/ocr',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('content' => '/9j/4AAQ...'),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/ocr"

payload={'content': '/9j/4AAQ...'}
files=[

]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/ocr' \
--header 'x-api-key: api_key_here' \
--form 'content="/9j/4AAQ..."'
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('content', '/9j/4AAQ...');

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/ocr',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Response example:

{
    "Status": 200,
    "ResultStatus": true,
    "ErrorMsg": "Ok",
    "Data": {
        "date": "Expense date",
        "price": "Expense price",
        "currency": "CURRENCY",
        "merchant": "Merchant name",
        "vat": {
            "vat_number": "VAT number",
            "country_code": "VAT country code",
            "company_name": "VAT owner company name",
            "company_address": "VAT owner company address"
        },
        "ndoc": "Document number"
    }
}

This endpoint captures and returns the fields of a receipt.

HTTP Request

POST https://service.fees.world/API/v1.2/ocr

Request Body (accepted values)

Value Type Description
file file Upload an image through form-data. Accepted formats are: JPEG PNG GIF BMP WEBP. Maximum file size is 10MB.
source string (url) Suggested for larger file sizes. Make sure that the url can be accessed by everyone.
content string (base64) Base64 encoding makes the file bigger and therefore slower to transfer. It's not recommended for large file sizes.


At least one of this values is required. Only one image will be processed per request.

Identity Cards OCR

Request example (files):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/id',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file1'=> new CURLFILE('/Path/To/File/back.png'),'file2'=> new CURLFILE('/Path/To/File/front.png')),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/id"

payload={}
files=[
  ('file1',('back.png',open('/Path/To/File/back.png','rb'),'image/png')),
  ('file2',('front.png',open('/Path/To/File/front.png','rb'),'image/png'))
]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/id' \
--header 'x-api-key: api_key_here' \
--form 'file1=@"/Path/To/File/back.png"' \
--form 'file2=@"/Path/To/File/front.png"'
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('file1', fs.createReadStream('/Path/To/File/back.png'));
data.append('file2', fs.createReadStream('/Path/To/File/front.png'));

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/id',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Request example (source):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/id',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('source' => 'https://www.yoursite.com/front.jpg','source' => 'https://www.yoursite.com/back.jpg'),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/id"

payload={'source': 'https://www.yoursite.com/front.jpg',
'source': 'https://www.yoursite.com/back.jpg'}
files=[

]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/id' \
--header 'x-api-key: api_key_here' \
--form 'source="https://www.yoursite.com/front.jpg"' \
--form 'source="https://www.yoursite.com/back.jpg"'
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('source', 'https://www.yoursite.com/front.jpg');
data.append('source', 'https://www.yoursite.com/back.jpg');

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/id',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Request example (content):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/id',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('content' => '/9j/4AAQ...(front)','content' => '/9j/4AAQ...(back)'),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/id"

payload={'content': '/9j/4AAQ...(front)',
'content': '/9j/4AAQ...(back)'}
files=[

]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/id' \
--header 'x-api-key: api_key_here' \
--form 'content="/9j/4AAQ...(front)"' \
--form 'content="/9j/4AAQ...(back)"'
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('content', '/9j/4AAQ...(front)');
data.append('content', '/9j/4AAQ...(back)');

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/id',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Response example:

{
    "Status": 200,
    "ResultStatus": true,
    "ErrorMsg": "Ok",
    "Data": {
        "surname": "Surname",
        "other_names": "Other names",
        "date_of_birth": "Date of birth",
        "place_of_birth": "Place of birth",
        "document_number": "Document number",
        "released_by": "Issuing authority",
        "date_of_expiry": "Date of expiry",
        "gender": "Gender",
        "location_residence": "Location of residence",
        "nationality": "Nationality",
        "fiscal_code": "Fiscal code"
    }
}

This endpoint captures and returns the fields of an identity card.

HTTP Request

POST https://service.fees.world/API/v1.2/id

Request Body (accepted values)

Value Type Description
file1 + file2 Two files Upload two images (front and back) through form-data. Accepted formats are: JPEG PNG GIF BMP WEBP. Maximum file size is 10MB.
source Array of strings (url) Suggested for larger file sizes. Make sure that both urls can be accessed by everyone.
content Array of base64 strings Base64 encoding makes the files bigger and therefore slower to transfer. It's not recommended for large file sizes.


At least one of this values is required. Exactly two images are needed per request (front and back).

Driving Licences OCR

Request example (files):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/dl',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file1'=> new CURLFILE('/Path/To/File/back.png'),'file2'=> new CURLFILE('/Path/To/File/front.png')),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/dl"

payload={}
files=[
  ('file1',('back.png',open('/Path/To/File/back.png','rb'),'image/png')),
  ('file2',('front.png',open('/Path/To/File/front.png','rb'),'image/png'))
]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/dl' \
--header 'x-api-key: api_key_here' \
--form 'file1=@"/Path/To/File/back.png"' \
--form 'file2=@"/Path/To/File/front.png"'
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('file1', fs.createReadStream('/Path/To/File/back.png'));
data.append('file2', fs.createReadStream('/Path/To/File/front.png'));

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/dl',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Request example (source):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/dl',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('source' => 'https://www.yoursite.com/front.jpg','source' => 'https://www.yoursite.com/back.jpg'),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/dl"

payload={'source': 'https://www.yoursite.com/front.jpg',
'source': 'https://www.yoursite.com/back.jpg'}
files=[

]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/dl' \
--header 'x-api-key: api_key_here' \
--form 'source="https://www.yoursite.com/front.jpg"' \
--form 'source="https://www.yoursite.com/back.jpg"'
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('source', 'https://www.yoursite.com/front.jpg');
data.append('source', 'https://www.yoursite.com/back.jpg');

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/dl',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Request example (content):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/dl',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('content' => '/9j/4AAQ...(front)','content' => '/9j/4AAQ...(back)'),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/dl"

payload={'content': '/9j/4AAQ...(front)',
'content': '/9j/4AAQ...(back)'}
files=[

]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/dl' \
--header 'x-api-key: api_key_here' \
--form 'content="/9j/4AAQ...(front)"' \
--form 'content="/9j/4AAQ...(back)"'
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('content', '/9j/4AAQ...(front)');
data.append('content', '/9j/4AAQ...(back)');

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/dl',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Response example:

{
    "Status": 200,
    "ResultStatus": true,
    "ErrorMsg": "Ok",
    "Data": {
        "surname": "Surname",
        "other_names": "Other names",
        "date_of_birth": "Date of birth",
        "place_of_birth": "Place of birth",
        "issue": {
            "date_of_issue": "Issuing date",
            "issuing_authority": "Issuing authority",
            "date_of_expiry": "Expiry date"
        },
        "licence_number": "Licence number",
        "licence_categories": "Licence categories"
    }
}

This endpoint captures and returns the fields of a driving licence.

HTTP Request

POST https://service.fees.world/API/v1.2/dl

Request Body (accepted values)

Value Type Description
file1 + file2 Two files Upload two images (front and back) through form-data. Accepted formats are: JPEG PNG GIF BMP WEBP. Maximum file size is 10MB.
source Array of strings (url) Suggested for larger file sizes. Make sure that both urls can be accessed by everyone.
content Array of base64 strings Base64 encoding makes the files bigger and therefore slower to transfer. It's not recommended for large file sizes.


At least one of this values is required. Exactly two images are needed per request (front and back).

Passports OCR

Request example (file):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/passport',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('/Path/To/File/passport.jpg')),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/passport"

payload={}
files=[
  ('file',('passport.jpg',open('/Path/To/File/passport.jpg','rb'),'image/jpg'))
]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/passport' \
--header 'x-api-key: api_key_here' \
--form 'file=@"/Path/To/File/passport.jpg"'
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('file', fs.createReadStream('/Path/To/File/passport.jpg'));

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/passport',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Request example (source):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/passport',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('source' => 'https://www.yoursite.com/passport.jpg'),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/passport"

payload={'source': 'https://www.yoursite.com/passport.jpg'}
files=[

]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/passport' \
--header 'x-api-key: api_key_here' \
--form 'source="https://www.yoursite.com/passport.jpg"'
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('source', 'https://www.yoursite.com/passport.jpg');

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/passport',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Request example (content):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/passport',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('content' => '/9j/4AAQ...'),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://service.fees.world/API/v1.2/passport"

payload={'content': '/9j/4AAQ...'}
files=[

]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
curl --location --request POST 'https://service.fees.world/API/v1.2/passport' \
--header 'x-api-key: api_key_here' \
--form 'content="/9j/4AAQ..."'
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('content', '/9j/4AAQ...');

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/passport',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Response example:

{
    "Status": 200,
    "ResultStatus": true,
    "ErrorMsg": "Ok",
    "Data": {
        "surname": "Surname",
        "other_names": "Other names",
        "date_of_birth": "Date of birth",
        "document_number": "Document number",
        "date_of_release": "Release date",
        "date_of_expiry": "Expiry date",
        "gender": "Gender",
        "location_residence": "Location of residence",
        "nationality": "Nationality"
    }
}

This endpoint captures and returns the fields of a passport.

HTTP Request

POST https://service.fees.world/API/v1.2/passport

Request Body (accepted values)

Value Type Description
file file Upload an image through form-data. Accepted formats are: JPEG PNG GIF BMP WEBP. Maximum file size is 10MB.
source string (url) Suggested for larger file sizes. Make sure that the url can be accessed by everyone.
content string (base64) Base64 encoding makes the file bigger and therefore slower to transfer. It's not recommended for large file sizes.


At least one of this values is required. Only one image will be processed per request.

Crop Document

Request example (file):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/crop',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('/Path/To/File/expense.jpg')),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
import requests

url = "https://service.fees.world/API/v1.2/crop"

payload={}
files=[
  ('file',('expense.jpg',open('/Path/To/File/expense.jpg','rb'),'image/jpg'))
]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)
curl --location --request POST 'https://service.fees.world/API/v1.2/crop' \
--header 'x-api-key: api_key_here' \
--form 'file=@"/Path/To/File/expense.jpg"'
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('file', fs.createReadStream('/Path/To/File/expense.jpg'));

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/crop',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  //use image here
})
.catch(function (error) {
  console.log(error);
});

Request example (content):

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://service.fees.world/API/v1.2/crop',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('content' => '/9j/4AAQ...'),
  CURLOPT_HTTPHEADER => array(
    'x-api-key: api_key_here'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
import requests

url = "https://service.fees.world/API/v1.2/crop"

payload={'content': '/9j/4AAQ...'}
files=[

]
headers = {
  'x-api-key': 'api_key_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)
curl --location --request POST 'https://service.fees.world/API/v1.2/crop' \
--header 'x-api-key: api_key_here' \
--form 'content="/9j/4AAQ..."'
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('content', '/9j/4AAQ...');

var config = {
  method: 'post',
  url: 'https://service.fees.world/API/v1.2/crop',
  headers: { 
    'x-api-key': 'api_key_here', 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  //use image here
})
.catch(function (error) {
  console.log(error);
});

Response example:

A cropped png of the original image

This endpoint removes the background from a photo containing a document and returns the cropped image.

HTTP Request

POST https://service.fees.world/API/v1.2/crop

Request Body (accepted values)

Value Type Description
file file Upload an image through form-data. Accepted formats are: JPEG PNG GIF BMP WEBP. Maximum file size is 10MB.
content string (base64) Base64 encoding makes the file bigger and therefore slower to transfer. It's not recommended for large file sizes.