The Barcode Report API allows users to search for barcode information and retrieve account details. This API is designed to provide users with access to barcode data stored in a MySQL database. It requires an API key for authentication and supports searching for barcode details.
Endpoint: /search_barcode
Method: GET
Parameters:
barcode
(required): The barcode to search for.api_key
(required): The API key for authentication.Response Codes:
200 OK
: Barcode found, returns barcode information.Endpoint: /account
Method: GET
Parameters:
api_key
(required): The API key for authentication.Response Codes:
200 OK
: Account information retrieved successfully.To access the API endpoints, you need to provide a valid API key in the request parameters. Without a valid API key, you will not be able to authenticate and access the API resources.
Make a GET request to the /search_barcode endpoint with the barcode and api_key parameters.
The API will return barcode information if found, or an error message if not found or if there's an issue.
Make a GET request to the /account endpoint with the api_key parameter.
The API will return account information if the API key is valid, or an error message if the API key is missing or invalid.
◉ Missing or invalid parameters will result in a 400 Bad Request response.
◉ Invalid API keys will result in a 403 Forbidden response.
◉ Internal errors during processing will result in a 500 Internal Server Error response.
Python
import requests # API endpoint endpoint = "https://barcodereport.com/api/search_barcode" # API key api_key = "your_api_key" # Barcode to search for barcode = "061500127178" # Construct the URL url = f"{endpoint}?barcode={barcode}&api_key={api_key}" # Make the GET request response = requests.get(url) data = response.json() print(data)
javascript
// API endpoint const endpoint = "https://barcodereport.com/api/search_barcode"; // API key const api_key = "your_api_key"; // Barcode to search for const barcode = "061500127178"; // Construct the URL const url = `${endpoint}?barcode=${barcode}&api_key=${api_key}`; // Make the GET request fetch(url) .then(response => response.json()) .then(data => console.log(data));
Ruby
require "net/http" require "json" # API endpoint endpoint = URI("https://barcodereport.com/api/search_barcode") # API key api_key = "your_api_key" # Barcode to search for barcode = "061500127178" # Construct the URL params = { "barcode" => barcode, "api_key" => api_key } endpoint.query = URI.encode_www_form(params) # Make the GET request response = Net::HTTP.get_response(endpoint) data = JSON.parse(response.body) puts data