{
    "openapi": "3.0.3",
    "info": {
        "title": "Orca Scan Barcode Parser API",
        "description": "Free API to parse, validate and extract data from raw barcode values. No authentication required.",
        "version": "1.0.0",
        "contact": {
            "name": "Orca Scan",
            "url": "https://orcascan.com"
        }
    },
    "servers": [
        {
            "url": "https://parser.orcascan.com",
            "description": "Production"
        }
    ],
    "externalDocs": {
        "description": "Full guide",
        "url": "https://orcascan.com/guides/barcode-parser-api-320fb366"
    },
    "paths": {
        "/": {
            "get": {
                "summary": "Parse a barcode value",
                "description": "Returns structured JSON with parsed fields, validation results and matching barcode data standards.",
                "operationId": "parseBarcode",
                "externalDocs": {
                    "description": "Full guide",
                    "url": "https://orcascan.com/guides/barcode-parser-api-320fb366"
                },
                "parameters": [
                    {
                        "name": "barcode",
                        "in": "query",
                        "description": "Raw barcode value to parse. Must be URL encoded.",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "examples": {
                            "gs1": {
                                "summary": "GS1 barcode",
                                "value": "0190076338838502320100062111210518217103001192"
                            },
                            "isbn": {
                                "summary": "ISBN barcode",
                                "value": "9780761169253"
                            },
                            "vin": {
                                "summary": "VIN barcode",
                                "value": "1GBEG25K9E7169086"
                            }
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Force parsing as a specific barcode data standard.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asin",
                                "bcbp",
                                "csv",
                                "ean",
                                "fmd",
                                "gs1",
                                "hibc",
                                "ical",
                                "ip",
                                "isbn",
                                "isbt",
                                "iso15434",
                                "json",
                                "mac",
                                "psv",
                                "tel",
                                "tsv",
                                "udi",
                                "upc",
                                "url",
                                "vcard",
                                "vin",
                                "wifi"
                            ]
                        }
                    },
                    {
                        "name": "data",
                        "in": "query",
                        "description": "Include parsed barcode data in matches.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false"
                            ],
                            "default": "true"
                        }
                    },
                    {
                        "name": "schema",
                        "in": "query",
                        "description": "Include JSON schema for parsed data in matches.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false"
                            ],
                            "default": "false"
                        }
                    },
                    {
                        "name": "regex",
                        "in": "query",
                        "description": "Parse only the value matched by a regex capture group.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "first",
                        "in": "query",
                        "description": "Return only the first matching result.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false"
                            ],
                            "default": "false"
                        }
                    },
                    {
                        "name": "case",
                        "in": "query",
                        "description": "Format keys in the response.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "human",
                                "upper",
                                "lower",
                                "title",
                                "camel",
                                "pascal"
                            ]
                        }
                    },
                    {
                        "name": "flat",
                        "in": "query",
                        "description": "Flatten the response.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false",
                                "full"
                            ],
                            "default": "false"
                        }
                    },
                    {
                        "name": "include",
                        "in": "query",
                        "description": "Comma separated list of fields to include.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "exclude",
                        "in": "query",
                        "description": "Comma separated list of fields to exclude.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "rename",
                        "in": "query",
                        "description": "Comma separated list of fields to rename in fromName:toName format.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Parsed barcode result.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "barcode": {
                                            "type": "string",
                                            "description": "The barcode value that was parsed."
                                        },
                                        "valid": {
                                            "type": "boolean",
                                            "description": "Whether the barcode matched at least one data standard."
                                        },
                                        "matches": {
                                            "type": "array",
                                            "description": "List of matching barcode data standards.",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "type": {
                                                        "type": "string",
                                                        "description": "The barcode data standard that matched."
                                                    },
                                                    "data": {
                                                        "type": "object",
                                                        "description": "Parsed barcode data fields."
                                                    },
                                                    "schema": {
                                                        "type": "object",
                                                        "description": "JSON schema describing the parsed data fields. Only included when schema=true."
                                                    }
                                                },
                                                "required": [
                                                    "type"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "barcode",
                                        "valid",
                                        "matches"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 400
                                        },
                                        "error": {
                                            "type": "string",
                                            "example": "Missing Query Parameter"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "The required parameter 'barcode' is missing"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded. Wait for the number of seconds in the Retry-After header.",
                        "headers": {
                            "Retry-After": {
                                "description": "Number of seconds to wait before retrying.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}