In this tutorial, we’ll demonstrate how to read barcodes with our locally hosted API Server. First of all, let’s build an API Endpoint Request URL. Normally, this request is of type POST only, but for this demo purpose, we’ll do a GET request so that we can see the output in the browser itself.

Base Endpoint URL for barcode reading is “barcode/read/from/url”. We need to provide additional parameters such as input URL, type of barcode to read, etc.

API Read Barcodes

Let’s put the request URL to the PDF.co base URL. Now, since it’s done, let’s put the type of barcode we intend to read. Please note that PDF.co supports various types of barcodes to read from. We can also specify more than one type by comma-separated.

In this demo, we’ll be using Code128. And finally, let’s add the source URL. This can be any URL pointing to either image or PDF. For this demo purpose, we’ll be using a local barcode URL.

Read Barcodes with API Server

With this, we’re done building API Endpoint making. Let’s execute it in the browser, and check the response. The output should read barcode text as “Hello12345”, and it is! As you have noticed, the output also contains watermark text, as we’re using an evaluation license.

Reading Barcodes with API Server