Skip to content

Instantly share code, notes, and snippets.

@blizzrdof77
Created January 30, 2023 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blizzrdof77/c3aa75284830179b44acc1aebd236e1a to your computer and use it in GitHub Desktop.
Save blizzrdof77/c3aa75284830179b44acc1aebd236e1a to your computer and use it in GitHub Desktop.
Go-UPC Barcode API: Open API 3.0 Definition
openapi: 3.0.0
servers:
- description: Go-UPC Barcode-Lookup API
url: https://go-upc.com/api/v1
info:
version: 1.0.0
title: Go-UPC Barcode-Lookup API
description: Find information on products from around the globe. The API supports UPC, EAN, and ISBN barcode numbers, and info returned includes product name, description, brand, image URL, and more.
paths:
/code/{code}:
get:
tags:
- Product
operationId : getProductInfo
parameters:
- name: code
in: path
required: true
schema:
type: string
summary: Retrieve product info for a particular barcode number (UPC, EAN, or ISBN).
responses:
200:
description: The product corresponding to the provided `code`
content:
application/json:
schema:
type: object
properties:
codeType:
type: string
description: The type of product code (UPC/EAN/ISBN).
enum:
- UPC
- EAN
- ISBN
example: UPC
barcodeUrl:
type: string
description: The URL to the scannable barcode image.
format: uri
example: 'https://go-upc.com/barcode/829576019311'
product:
type: object
description: all matching product details.
properties:
name:
type: string
description: The name of the product.
example: "Blue Sage Tonka Texturizing Fiber"
region:
type: string
description: The region of the product.
example: "USA or Canada"
description:
type: string
description: A description of the product (if available).
example: >-
Gives you an easy way to achieve the hairstyle you love. Made with jojoba esters, vegetable-derived lanolin, glycerin and carnauba wax.
imageUrl:
type: string
description: The URL for the product image.
format: uri
example: 'http://go-upc.s3.amazonaws.com/images/54066938.jpeg'
brand:
type: string
description: The brand of the product (if available).
example: "Goodfellow and Co"
specs:
type: array
description: A list of additional item specifications (if available).
items:
type: array
items:
type: string
example:
-
- Item Form
- Clay
-
- Liquid Volume
- 4 Fluid Ounces
-
- Scent
- Lime
category:
type: string
description: The category of the product (if available).
example: "Hair Care"
upc:
type: integer
description: The UPC code of the product.
example: 829576019311
ean:
type: integer
description: The EAN code of the product.
example: 829576019311
404:
description: No product information was found for the given `code`.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
500:
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
components:
schemas:
code:
type: string
description: The standardized product code in UPC/EAN format.
$ref: '#/components/schemas/code'
error:
type: object
required:
- error
properties:
code:
description: The provided code.
type: string
example: '329576019311'
codeType:
description: The type of code provided.
example: null
error:
description: A human readable error message.
type: string
example: The provided code is not in a recognized format.
securitySchemes:
ApiKeyAuth:
type: apiKey
in: query
name: key
security:
- ApiKeyAuth: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment