Barcode Reader
Read barcodes from images and PDF. Can read all popular barcode types from QR Code
and Code 128
, EAN
to Datamatrix
, PDF417
, GS1
and many other barcodes.
Available Methods
[POST] /barcode/read/from/url
Need to split PDF by barcode? Check PDF Split by Barcode
(pdf/split2
endpoint).
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section. If you are randomly gettingToo Many Requests
orAccess Denied
error for your input url, please try to addcache:
to enable built-in url caching. You can also encrypt data for output files and decrypt data input files with user-controlled data encryption (uses strongAES
encryption with your own keys). Click here to learn more.httpusername
(optional) - http auth user name if required to access sourceurl
.httppassword
(optional) - http auth password if required to access sourceurl
.types
. required. Comma-separated list of barcode types to decode.
Supported Barcode Types:
AustralianPostCode
Aztec
BorderedTable
Checkbox
Circle
CircularI2of5
Codabar
CodablockF
Code128
Code16K
Code39
Code39Extended
Code39Mod43
Code39Mod43Extended
Code93
DataMatrix
DPMDataMatrix
EAN13
EAN2
EAN5
EAN8
GS1
GS1DataBarExpanded
GS1DataBarExpandedStacked
GS1DataBarLimited
GS1DataBarOmnidirectional
GS1DataBarStacked
GTIN12
GTIN13
GTIN14
GTIN8
HorizontalLine
IntelligentMail
Interleaved2of5
ITF14
MaxiCode
MICR
MicroPDF
MSI
Oval
PatchCode
PDF417
Pharmacode
PostNet
PZN
QRCode
Rectangle
RoyalMail
RoyalMailKIX
Segment
Trioptic
UnderlinedField
UPCA
UPCE
UPU
VerticalLine
pages
. optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the end of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.*async
optional. Runs processing asynchronously. ReturnsJobId
that you may use with/job/check
to check state of the background job (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.profiles
optional. Must be a String. Use this parameter to set additional configuration for fine tuning and extra options. Explore PDF.co knowledgebase for profile examples.- Method: POST
- URL: /v1/barcode/read/from/url
Query parameters
No query parameters accepted.
Body payload
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"types": "QRCode,Code128,Code39,Interleaved2of5,EAN13",
"pages": "0",
"encrypt": false,
"async": false
}
Example responses
/barcode/read/from/url
{
"barcodes": [
{
"Value": "abcdef123456",
"RawData": "",
"Type": 14,
"Rect": "{X=448,Y=23,Width=106,Height=112}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 1,
"Metadata": "",
"TypeName": "QRCode"
},
{
"Value": "test123",
"RawData": "",
"Type": 2,
"Rect": "{X=111,Y=60,Width=255,Height=37}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 0.90625155,
"Metadata": "",
"TypeName": "Code128"
},
{
"Value": "123456",
"RawData": "",
"Type": 4,
"Rect": "{X=111,Y=129,Width=306,Height=37}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 0.7710818,
"Metadata": "",
"TypeName": "Code39"
},
{
"Value": "<FNC1>0112345678901231",
"RawData": "",
"Type": 2,
"Rect": "{X=111,Y=198,Width=305,Height=37}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 0.9156459,
"Metadata": "",
"TypeName": "Code128"
},
{
"Value": "12345670",
"RawData": [
1,
2,
3,
4,
5,
6,
7,
0
],
"Type": 5,
"Rect": "{X=111,Y=267,Width=182,Height=0}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 1,
"Metadata": "",
"TypeName": "I2of5"
},
{
"Value": "1234567890128",
"RawData": "",
"Type": 6,
"Rect": "{X=102,Y=336,Width=71,Height=72}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 0.895925164,
"Metadata": "",
"TypeName": "EAN13"
}
],
"pageCount": 1,
"error": false,
"status": 200,
"remainingCredits": 99826192,
"credits": 35
}
Code Snippet
CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/read/from/url' \
--header 'x-api-key: ' \
--data-raw '{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"types": "QRCode,Code128,Code39,Interleaved2of5,EAN13",
"pages": "0",
"encrypt": false,
"async": false
}'
[POST] /barcode/read/from/url (read qr code)
Need to split PDF by barcode? Check PDF Split by Barcode
(pdf/split2
endpoint).
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section. If you are randomly gettingToo Many Requests
orAccess Denied
error for your input url, please try to addcache:
to enable built-in url caching. You can also encrypt data for output files and decrypt data input files with user-controlled data encryption (uses strongAES
encryption with your own keys). Click here to learn more.httpusername
(optional) - http auth user name if required to access sourceurl
.httppassword
(optional) - http auth password if required to access sourceurl
.types
. required. Comma-separated list of barcode types to decode.
Supported Barcode Types:
AustralianPostCode
Aztec
BorderedTable
Checkbox
Circle
CircularI2of5
Codabar
CodablockF
Code128
Code16K
Code39
Code39Extended
Code39Mod43
Code39Mod43Extended
Code93
DataMatrix
DPMDataMatrix
EAN13
EAN2
EAN5
EAN8
GS1
GS1DataBarExpanded
GS1DataBarExpandedStacked
GS1DataBarLimited
GS1DataBarOmnidirectional
GS1DataBarStacked
GTIN12
GTIN13
GTIN14
GTIN8
HorizontalLine
IntelligentMail
Interleaved2of5
ITF14
MaxiCode
MICR
MicroPDF
MSI
Oval
PatchCode
PDF417
Pharmacode
PostNet
PZN
QRCode
Rectangle
RoyalMail
RoyalMailKIX
Segment
Trioptic
UnderlinedField
UPCA
UPCE
UPU
VerticalLine
pages
. optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the end of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.*async
optional. Runs processing asynchronously. ReturnsJobId
that you may use with/job/check
to check state of the background job (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.profiles
optional. Must be a String. Use this parameter to set additional configuration for fine tuning and extra options. Explore PDF.co knowledgebase for profile examples.- Method: POST
- URL: /v1/barcode/read/from/url
Query parameters
No query parameters accepted.
Body payload
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"types": "QRCode",
"pages": "0",
"encrypt": false,
"async": false
}
Example responses
/barcode/read/from/url (read qr code)
{
"barcodes": [
{
"Value": "abcdef123456",
"RawData": "",
"Type": 14,
"Rect": "{X=448,Y=23,Width=106,Height=112}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 1,
"Metadata": "",
"TypeName": "QRCode"
}
],
"pageCount": 1,
"error": false,
"status": 200,
"duration": 781,
"remainingCredits": 98725563,
"credits": 35
}
Code Snippet
CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/read/from/url' \
--header 'x-api-key: ' \
--data-raw '{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"types": "QRCode",
"pages": "0",
"encrypt": false,
"async": false
}'
Samples
- AWS Lambda - Read Barcode From URL (Node.js)
- C# - Advanced Conversion Options
- C# - Async File Uploading
- C# - Async file upload and async barcode reading
- C# - Read Barcode From Encrypted URL
- C# - Read Barcode From URL
- C# - Read Barcode From URL Asynchronously
- C# - Read Barcode From Uploaded File
- C# - Read Code 128
- C# - Read EAN 13
- C# - Read QR Code
- GoogleAppScript - Read QR Code From PDF
- Java - Advanced Conversation Options
- Java - Read Barcode From Encrypted URL
- Java - Read Barcode From URL
- Java - Read Barcode From Uploaded File
- JavaScript - Advanced Conversion Options
- JavaScript - Read Barcode From Encrypted URL
- JavaScript - Read Barcode From File (Node.js) - Async Api
- JavaScript - Read Barcode From Live Camera
- JavaScript - Read Barcode From URL (Node.js)
- JavaScript - Read Barcode From URL (Node.js) - Async API
- JavaScript - Read Barcode From Uploaded File (Node.js)
- JavaScript - Read Barcode From Uploaded File (Node.js) - Async Api
- PHP - Read Barcode From Encrypted URL Asynchronously
- PHP - Read Barcode From URL Asynchronously
- PHP - Read Barcode From Uploaded File
- PowerShell - Advanced Conversion Options
- PowerShell - Read Barcode From Encrypted URL
- PowerShell - Read Barcode From URL
- PowerShell - Read Barcode From URL Asynchronously
- PowerShell - Read Barcode From Uploaded File
- Python - Advanced Conversation Options
- Python - Read Barcode From Encrypted URL
- Python - Read Barcode From URL
- Python - Read Barcode From Uploaded File
- VB.NET - Advanced Conversion Options
- VB.NET - Async File Upload and Async Barcode Reading
- VB.NET - Async File Uploading
- VB.NET - Read Barcode From Encrypted URL
- VB.NET - Read Barcode From URL
- VB.NET - Read Barcode From URL Asynchronously
- VB.NET - Read Barcode From Uploaded File
- VB.NET - Read Code 128
- VB.NET - Read EAN 13
- VB.NET - Read QR Code
- cURL - Barcode Reader
- cURL - Detect BorderedTable from PDF
- cURL - Detect Checkbox from PDF
- cURL - Detect Circle from PDF
- cURL - Detect HorizontalLine from PDF
- cURL - Detect Oval from PDF
- cURL - Detect Rectangle from PDF
- cURL - Detect UnderlinedField from PDF
- cURL - Detect VerticalLine from PDF
- cURL - Read Barcode From Encrypted URL
Copyright © 2016 - 2023 PDF.co