Link Search Menu Expand Document

Barcode Generator

Explore Samples

Generate high quality barcode images. Supports QR Code, Datamatrix, Code 39, Code 128, PDF417 and many other barcode types.

Available Methods

[POST] /barcode/generate

Attributes
value required
Set the string value to encode inside the barcode. Must be in a “string” format.
type optional
Set the barcode type, QRCode By default.
supported barcode types:
Code128, Code39, Postnet, UPCA, EAN8, ISBN, Codabar, I2of5, Code93, EAN13, JAN13, Bookland, UPCE, PDF417, PDF417Truncated, DataMatrix, QRCode, Aztec, Planet, EAN128, GS1_128, USPSSackLabel, USPSTrayLabel, DeutschePostIdentcode, DeutschePostLeitcode, Numly, PZN, OpticalProduct, SwissPostParcel, RoyalMail, DutchKix, SingaporePostalCode, EAN2, EAN5, EAN14, MacroPDF417, MicroPDF417, GS1_DataMatrix, Telepen, IntelligentMail, GS1_DataBar_Omnidirectional, GS1_DataBar_Truncated, GS1_DataBar_Stacked, GS1_DataBar_Stacked_Omnidirectional, GS1_DataBar_Limited, GS1_DataBar_Expanded, GS1_DataBar_Expanded_Stacked, MaxiCode, Plessey, MSI, ITF14, GTIN12, GTIN8, GTIN13, GTIN14, GS1_QRCode, PharmaCode
name optional
File name for the generated output. Must be in a “string” format.
expiration optional
Set the expiration time for the output link in minutes (default is 60 i.e 60 minutes or 1 hour), After this specified duration, any generated output file(s) will be automatically deleted from PDF.co temporary files storage. The maximum duration for link expiration varies based on your current subscription plan. Learn more

To store permanent input files (e.g. re-usable images, pdf templates, documents), Consider using PDF.co built-in Files Storage.
inline optional
Must be one of: true to return data as inline or false to return the link to the output file (default).
decorationImage optional, QR-Code only
Set this to the image that you want to be inserted the logo inside the QR-Code barcode. To use your file please upload it first to the temporary storage, see the Upload and Manage Files section below to learn how to do it.
async optional
Set async to true for long processes to run in the background, API will then return a jobId which you can use with /job/check endpoint to check the status of the process and retrieve the output while you can proceed with other tasks without waiting for this process to finish.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Must be in a “string” format. Explore PDF.co knowledgebase for profile examples.
  • Method: POST
  • URL: /v1/barcode/generate

Query parameters

No query parameters accepted.

Body payload

{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "async": false
}

Example responses

/barcode/generate
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/9a87556a8b9e4f4eae60843e697250d4/barcode.png",
    "error": false,
    "status": 200,
    "name": "barcode.png",
    "remainingCredits": 60631
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/generate' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ' \
--data-raw '{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "async": false
}'

[POST] /barcode/generate (qr code)

Attributes
value required
Set the string value to encode inside the barcode. Must be in a “string” format.
type optional
Set the barcode type, Must be in a “string” format. QRCode By default.
supported barcode types:
Code128, Code39, Postnet, UPCA, EAN8, ISBN, Codabar, I2of5, Code93, EAN13, JAN13, Bookland, UPCE, PDF417, PDF417Truncated, DataMatrix, QRCode, Aztec, Planet, EAN128, GS1_128, USPSSackLabel, USPSTrayLabel, DeutschePostIdentcode, DeutschePostLeitcode, Numly, PZN, OpticalProduct, SwissPostParcel, RoyalMail, DutchKix, SingaporePostalCode, EAN2, EAN5, EAN14, MacroPDF417, MicroPDF417, GS1_DataMatrix, Telepen, IntelligentMail, GS1_DataBar_Omnidirectional, GS1_DataBar_Truncated, GS1_DataBar_Stacked, GS1_DataBar_Stacked_Omnidirectional, GS1_DataBar_Limited, GS1_DataBar_Expanded, GS1_DataBar_Expanded_Stacked, MaxiCode, Plessey, MSI, ITF14, GTIN12, GTIN8, GTIN13, GTIN14, GS1_QRCode, PharmaCode
name optional
File name for the generated output. Must be in a “string” format.
expiration optional
Set the expiration time for the output link in minutes (default is 60 i.e 60 minutes or 1 hour), After this specified duration, any generated output file(s) will be automatically deleted from PDF.co temporary files storage. The maximum duration for link expiration varies based on your current subscription plan. Learn more

To store permanent input files (e.g. re-usable images, pdf templates, documents), Consider using PDF.co built-in Files Storage.
inline optional
Must be one of: true to return data as inline or false to return the link to the output file (default).
decorationImage optional, QR-Code only
Set this to the image that you want to be inserted the logo inside the QR-Code barcode. To use your file please upload it first to the temporary storage, see the Upload and Manage Files section below to learn how to do it.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Must be in a “string” format. Explore PDF.co knowledgebase for profile examples.
  • Method: POST
  • URL: /v1/barcode/generate

Query parameters

No query parameters accepted.

Body payload

{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": false,
    "async": false
}

Example responses

/barcode/generate (qr code)
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/72bc579b37844d9f9e63ce06de5196d8/barcode.png",
    "error": false,
    "status": 200,
    "name": "barcode.png",
    "duration": 380,
    "remainingCredits": 98725598,
    "credits": 7
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/generate' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ' \
--data-raw '{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": false,
    "async": false
}'

[POST] /barcode/generate (qr code with logo inside)

Attributes
value required
Set the string value to encode inside the barcode. Must be in a “string” format.
type optional
Set the barcode type, Must be in a “string” format. QRCode By default.
supported barcode types:
Code128, Code39, Postnet, UPCA, EAN8, ISBN, Codabar, I2of5, Code93, EAN13, JAN13, Bookland, UPCE, PDF417, PDF417Truncated, DataMatrix, QRCode, Aztec, Planet, EAN128, GS1_128, USPSSackLabel, USPSTrayLabel, DeutschePostIdentcode, DeutschePostLeitcode, Numly, PZN, OpticalProduct, SwissPostParcel, RoyalMail, DutchKix, SingaporePostalCode, EAN2, EAN5, EAN14, MacroPDF417, MicroPDF417, GS1_DataMatrix, Telepen, IntelligentMail, GS1_DataBar_Omnidirectional, GS1_DataBar_Truncated, GS1_DataBar_Stacked, GS1_DataBar_Stacked_Omnidirectional, GS1_DataBar_Limited, GS1_DataBar_Expanded, GS1_DataBar_Expanded_Stacked, MaxiCode, Plessey, MSI, ITF14, GTIN12, GTIN8, GTIN13, GTIN14, GS1_QRCode, PharmaCode
name optional
File name for the generated output. Must be in a “string” format.
expiration optional
Set the expiration time for the output link in minutes (default is 60 i.e 60 minutes or 1 hour), After this specified duration, any generated output file(s) will be automatically deleted from PDF.co temporary files storage. The maximum duration for link expiration varies based on your current subscription plan. Learn more

To store permanent input files (e.g. re-usable images, pdf templates, documents), Consider using PDF.co built-in Files Storage.
inline optional
Must be one of: true to return data as inline or false to return a link to the output file (default).
decorationImage optional, QR-Code only
Set this to the image that you want to be inserted the logo inside the QR-Code barcode. To use your file please upload it first to the temporary storage, see the Upload and Manage Files section below to learn how to do it.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Must be in a “string” format. Explore PDF.co knowledgebase for profile examples.
  • Method: POST
  • URL: /v1/barcode/generate

Query parameters

No query parameters accepted.

Body payload

{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": false,
    "async": false,
    "decorationImage": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/barcode-generator/logo.png"
}

Example responses

/barcode/generate
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/9a87556a8b9e4f4eae60843e697250d4/barcode.png",
    "error": false,
    "status": 200,
    "name": "barcode.png",
    "remainingCredits": 60631
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/generate' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ' \
--data-raw '{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": false,
    "async": false,
    "decorationImage": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/barcode-generator/logo.png"
}'

[POST] /barcode/generate (datauri as output)

Attributes
value required
Set the string value to encode inside the barcode. Must be in a “string” format.
type optional
Set the barcode type, Must be in a “string” format. QRCode By default.
supported barcode types:
Code128, Code39, Postnet, UPCA, EAN8, ISBN, Codabar, I2of5, Code93, EAN13, JAN13, Bookland, UPCE, PDF417, PDF417Truncated, DataMatrix, QRCode, Aztec, Planet, EAN128, GS1_128, USPSSackLabel, USPSTrayLabel, DeutschePostIdentcode, DeutschePostLeitcode, Numly, PZN, OpticalProduct, SwissPostParcel, RoyalMail, DutchKix, SingaporePostalCode, EAN2, EAN5, EAN14, MacroPDF417, MicroPDF417, GS1_DataMatrix, Telepen, IntelligentMail, GS1_DataBar_Omnidirectional, GS1_DataBar_Truncated, GS1_DataBar_Stacked, GS1_DataBar_Stacked_Omnidirectional, GS1_DataBar_Limited, GS1_DataBar_Expanded, GS1_DataBar_Expanded_Stacked, MaxiCode, Plessey, MSI, ITF14, GTIN12, GTIN8, GTIN13, GTIN14, GS1_QRCode, PharmaCode
name optional
File name for the generated output. Must be in a “string” format.
expiration optional
Set the expiration time for the output link in minutes (default is 60 i.e 60 minutes or 1 hour), After this specified duration, any generated output file(s) will be automatically deleted from PDF.co temporary files storage. The maximum duration for link expiration varies based on your current subscription plan. Learn more

To store permanent input files (e.g. re-usable images, pdf templates, documents), Consider using PDF.co built-in Files Storage.
inline optional
Must be one of: true to return data as inline or false to return a link to the output file (default).
decorationImage optional, QR-Code only
Set this to the image that you want to be inserted the logo inside the QR-Code barcode. To use your file please upload it first to the temporary storage, see the Upload and Manage Files section below to learn how to do it.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Must be in a “string” format. Explore PDF.co knowledgebase for profile examples.
  • Method: POST
  • URL: /v1/barcode/generate

Query parameters

No query parameters accepted.

Body payload

{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": true,
    "async": false
}

Example responses

/barcode/generate (datauri as output)
{
    "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAOlSURBVHhe7ZBBimMxEMVy/0v34CELkSmBjH96NhaIwKtXlY9fP5fMfawN7mNtcB9rg/tYG9zH2kAf6/V6Pa5hHeaUTPNTjftYg8Z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yQ1s89JTEcsIONabup8Ryo7Uuf7mPtcF9rA3uY21wH2uD+1iZn58/9whzEbhRquEAAAAASUVORK5CYII=",
    "error": false,
    "status": 200,
    "name": "barcode.png",
    "duration": 298,
    "remainingCredits": 98725605,
    "credits": 7
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/generate' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ' \
--data-raw '{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": true,
    "async": false
}'

Samples