Scanning From Web Pages

Sean Owen edited this page Jul 3, 2017 · 2 revisions


On Android, you can invoke Barcode Scanner from a web page and have the result returned to your site via a callback URL. For example, when 01234 is scanned, to have the user return to, simply link to a URL like this, where {CODE} is a placeholder for the value of the returned code:,EAN_13

Note that the URL in the ret= parameter is URL-escaped, and that {CODE} is used as a placeholder for the scanned value (above, it appears as %7BCODE%7D). SCAN_FORMATS, and other parameters, can be set here as well to control the scan behavior. For example is can be used to supply a comma-separated list of format names.

Additional placeholders are available in the URL pattern:

  • {CODE}: the formatted content of the barcode, or the raw content (unparsed) if raw=true
  • {RAWCODE}: the raw content (unparsed)
  • {FORMAT}: the name of the barcode format scanned like UPC_A
  • {TYPE}: the name of the type of parsed content, like PRODUCT
  • {META}: a string representation of the scan metadata, like {POSSIBLE_COUNTRY=US/CA}

The following URL also works, and some have found it works where the HTTP URL above doesn't. This also shows usage of SCAN_FORMATS:


Custom search URL

Separately, users can specify a custom search URL to invoke when a barcode is scanned with the Android app Barcode Scanner. When set under Settings, a Custom Search button will appear. The search URL can contain two placeholders: %s for the barcode content, %t the type, and %f for the format. For example, might invoke, on a scan, a URL like

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.