post https://spreadly.app/api/v1/business-card-scans
Make your first request
curl --request POST \
--url https://spreadly.app/api/v1/business-card-scans \
--header 'accept: application/json' \
--header 'authorization: {apiKey}' \
--header 'content-type: multipart/form-data' \
--form [email protected]
const axios = require('axios');
const fs = require('fs');
// Create a FormData object to simulate multipart/form-data
const formData = new FormData();
formData.append('front', fs.createReadStream('/path/to/image.png'), 'image.png');
// Set headers with Bearer token and Content-Type
const headers = {
'Authorization': `Bearer {apiKey}`,
'Content-Type': 'multipart/form-data',
};
// Make the POST request with Axios
axios.post('https://spreadly.app/api/v1/business-card-scans', formData, { headers })
.then(response => {
// Handle the response
const scan = response.data;
console.log('Scanned card', {scan});
})
.catch(error => {
// Handle errors
console.error('Error:', error.message);
});
import requests
# Set headers with Bearer token and Content-Type
headers = {
'Authorization': f'Bearer {apiKey}',
}
# Create a dictionary to simulate multipart/form-data
files = {
'front': ('image.png', open('/path/to/image.png', 'rb')),
}
# Make the POST request with requests
response = requests.post('https://spreadly.app/api/v1/business-card-scans', headers=headers, files=files)
# Handle the response
scan = response.json()
print('Response:', scan)
import 'dart:io';
import 'package:dio/dio.dart';
Future<void> uploadImage() async {
// Set headers with Bearer token
Options options = Options(
headers: {
'Authorization': 'Bearer $apiKey',
'Content-Type': 'multipart/form-data',
},
);
// Create FormData to simulate multipart/form-data
FormData formData = FormData.fromMap({
'front': await MultipartFile.fromFile('/path/to/image.png', filename: 'image.png'),
});
try {
// Make the POST request with dio
Response response = await Dio().post(
'https://spreadly.app/api/v1/business-card-scans',
data: formData,
options: options
);
// Handle the response
Map<String, dynamic> scan = response.data;
print('Response: $scan');
} catch (e) {
// Handle errors
print('Error: $e');
}
}
void main() {
uploadImage();
}
<?php
require 'vendor/autoload.php'; // Make sure to include GuzzleHTTP library
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
// Create a Guzzle HTTP client
$client = new Client(['headers' => [
'Authorization' => 'Bearer {apiKey}',
'Content-Type' => 'multipart/form-data',
]]);
// Make the POST request with Guzzle
$response = $client->request('POST', 'https://spreadly.app/api/v1/business-card-scans', [
'multipart' => [
[
'name' => 'front',
'contents' => fopen('/path/to/image.png', 'r'),
'filename' => 'image.png',
],
],
]);
$scan = json_decode($response->getBody(), true);
Response Properties
List of properties may change in future
New features may lead to new properties being used in the future.
Property | Type | Description |
---|---|---|
id | integer | ID of the scan |
given_name | string , null | Given name found on the card |
family_name | string , null | Family name on the card |
is_company | boolean | Does the card just show a company |
company | string , null | Company on the card |
position | string , null | Position on the card |
department | string , null | Department on the card |
emails | array of string | All email addresses on the card |
phones | array of string | All phones on the card |
mobiles | array of string | All mobile phone numbers on the card |
faxes | array of string | All fax numbers found on card |
websites | array of string | All websites on the card |
addresses | array of string | All addresses on the card |
addresses_formatted | array of object | Array of formatted addresses |
addresses_formatted[][street] | string , null | Street of the address |
addresses_formatted[][city] | string , null | City of the address |
addresses_formatted[][postal_code] | string , null | Postal code |
addresses_formatted[][region] | string , null | Region of the address |
addresses_formatted[][country] | string , null | Country of the address |
image_urls.front | string | Link to the uploaded front image |
image_urls.back | string , null | Link to the uploaded back image |
Improve your results
To get the best results with our API, upload images in the best possible resolution and with a business card only.
Test our scanner
You can share your API keys from Spreadly with ReadMe.io by using the same email address for the accounts.