API Documentation

The barcodes4.me web API can be used to generate barcodes and/or QR codes for your websites, web applications or other use.

The API uses a very simple RESTful interface. Each barcode can be generated by creating the proper URL.

Barcodes

Types

Currently, the API supports the following barcode types:

  • Code 39 (c39)
  • Code 128a (c128a)
  • Code 128b (c128b)
  • Code 128c (c128c)
  • 4 of 5 Interleaved (i2of5)

URL Format

Each URL follows the following format:

http://barcodes4.me/barcode/[type]/[value].[imagetype]

To build your URL:

  1. Replace [type] with the necessary type (c39, c128a, c128b, c128c, i2of5).
  2. Replace [value] with the value of your requested barcode.
  3. Replace [imagetype] with the type of image you would like created (png, gif, jpg). Use htm for more information about the barcode.

A Few Samples

http://www.barcodes4.me/barcode/c39/AnyValueYouWish.png http://www.barcodes4.me/barcode/c128b/AnyValueYouWish.gif http://www.barcodes4.me/barcode/i2of5/1234567.jpg

Additional Options

A number of additional options are available through the use of a URL query string suffixed to your base URL.

Custom Size

Use the width and height query parameters to create a barcode with custom pixel dimensions. (Default: 250x100)

?width=400&height=200

Render Text beneath barcode

To render the value of the barcode as text beneath, use the IsTextDrawn boolean parameter. You may also use the TextSize parameter to change the size of the text (Default: 5).

?IsTextDrawn=1

Render Border

To render a 1 pixel black border around the image, use the IsBorderDrawn boolean parameter.

?IsBorderDrawn=1

Reversed Colors

Barcodes4.me currently only supports black and which barcodes. By default barcodes are generated with black ink on a white background. You can reverse this by using the IsReverseColor boolean parameter.

?IsReverseColor=1

QR Codes

URL Format

Each URL follows the following format:

http://barcodes4.me/barcode/qr/[filename].[imagetype]?value=[value]

To build your URL:

  1. Replace [filename] with a valid filename for the image.
  2. Replace [imagetype] with the type of image you would like created (png, gif, jpg). Use htm for more information about the barcode.
  3. Replace [value] with the value of your requested barcode.

A Few Samples

http://www.barcodes4.me/barcode/qr/myfilename.png?value=My%20QR%20Code http://www.barcodes4.me/barcode/qr/google.png?value=http%3A%2F%2Fwww.google.com%2F

Additional Options

A number of additional options are available through the use of a URL query string suffixed to your base URL.

Size

QR codes can be generated in any of the following sizes though use of the size parameter:

Value Dimensions
1 21 x 21
2 42 x 42
3 63 x 63
4 84 x 84
5 105 x 105
6 126 x 126
7 147 x 147
8 168 x 168
9 189 x 189
10 210 x 210
?size=1

Error Correction Capability (ECC) Level

To specify the ECC Level, use the eccLevel parameter:

Value Level Codeword Restoration
0 Low (L) 7%
1 Medium-Low (M) 15%
2 Medium-High (Q) 25%
3 High (H) 30%
?ecclevel=3