{"id":19528510,"url":"https://github.com/orca-scan/orca-lookup-python","last_synced_at":"2026-05-09T06:33:29.833Z","repository":{"id":39658323,"uuid":"304951930","full_name":"orca-scan/orca-lookup-python","owner":"orca-scan","description":"How to respond to an Orca Scan Lookup request using Python","archived":false,"fork":false,"pushed_at":"2022-05-28T21:44:00.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-23T14:57:45.968Z","etag":null,"topics":["barcode-scanning","flask","python","smartphone"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orca-scan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-17T19:18:09.000Z","updated_at":"2022-05-28T21:43:59.000Z","dependencies_parsed_at":"2022-09-20T07:13:02.736Z","dependency_job_id":null,"html_url":"https://github.com/orca-scan/orca-lookup-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/orca-scan/orca-lookup-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orca-scan%2Forca-lookup-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orca-scan%2Forca-lookup-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orca-scan%2Forca-lookup-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orca-scan%2Forca-lookup-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orca-scan","download_url":"https://codeload.github.com/orca-scan/orca-lookup-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orca-scan%2Forca-lookup-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32809668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barcode-scanning","flask","python","smartphone"],"created_at":"2024-11-11T01:19:06.597Z","updated_at":"2026-05-09T06:33:29.804Z","avatar_url":"https://github.com/orca-scan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# orca-lookup-python\n\nThis open source project is a an example of [how to scan barcodes using a smartphone](https://orcascan.com/mobile) and [present data from your system](https://orcascan.com/docs/api/lookup-url) using [Python](https://www.python.org/) and the [flask](https://github.com/pallets/flask) framework.\n\n**How it works:**\n\n1. A user [scans a barcode](https://orcascan.com/mobile) using their smartphone\n2. Orca Scan sends a HTTP GET request to your endpoint with `?barcode=value`\n3. Your system queries a database or internal API for a `barcode` match\n4. Your system returns the data in JSON format with keys matching column names\n5. The [Orca Scan mobile](https://orcascan.com/mobile) app presents that data to the user\n\n*If the mobile user has [update permission](https://orcascan.com/docs/getting-started/adding-users#selecting-user-permissions) and saves the data, it will saved to your Orca sheet.*\n\n## Install\n\nFirst ensure you have [Python](https://www.python.org/downloads/) installed:\n\n**macOS or Linux**\n```bash\n# should return 3.7 or higher\npython3 --version\n```\n\n**Windows**\n```bash\n# should return 3.7 or higher\npython --version\n```\n\nThen execute the following:\n\n```bash\n# download this example code\ngit clone https://github.com/orca-scan/orca-lookup-python.git\n\n# go into the new directory\ncd orca-lookup-python\n```\n**macOS or Linux**\n```bash\n# create virtual environment and activate it\npython3 -m venv orca \u0026\u0026 source ./orca/bin/activate\n```\n**Windows**\n```bash\n# create virtual environment and activate it\npython -m venv orca \u0026\u0026 source ./orca/scripts/activate\n```\n**All**\n```bash\n# upgrade pip to latest version\npython -m pip install --upgrade pip\n\n# install dependencies\npip install -r requirements.txt\n```\n\n## Run\n\n**macOS or Linux**\n```bash\n# activate virtual environment\nsource ./orca/bin/activate\n```\n**Windows**\n```bash\n# activate virtual environment\nsource ./orca/scripts/activate\n```\n**All**\n```bash\n# start the project\nflask run\n```\n\nVisit [http://localhost:5000?barcode=4S3BMHB68B3286050](http://localhost:5000?barcode=4S3BMHB68B3286050) to see the following:\n\n```json\n{\n    \"VIN\": \"4S3BMHB68B3286050\",\n    \"Make\": \"SUBARU\",\n    \"Model\": \"Legacy\",\n    \"Manufacturer Name\": \"FUJI HEAVY INDUSTRIES U.S.A\",\n    \"Vehicle Type\": \"PASSENGER CAR\",\n    \"Year\": 1992\n}\n```\n\n## How this example works\n\nThis [example](app.py) uses the [flask](https://github.com/pallets/flask) framework:\n\n```python\n# GET / handler\n@app.route(\"/\")\ndef index():\n\n    # get the incoming barcode sent from Orca Scan (scanned by a user)\n    barcode = request.args.get(\"barcode\")\n\n    # TODO: query a database or API to retrieve some data based on barcode value\n    data = {\n        \"VIN\": barcode,\n        \"Make\": \"SUBARU\",\n        \"Model\": \"Legacy\",\n        \"Manufacturer Name\": \"FUJI HEAVY INDUSTRIES U.S.A\",\n        \"Vehicle Type\": \"PASSENGER CAR\",\n        \"Year\": 1992\n    }\n\n    # return data in JSON format (property names must match Orca column names)\n    return jsonify(data)\n```\n\n## Troubleshooting\n\nIf you run into any issues not listed here, please [open a ticket](https://github.com/orca-scan/orca-lookup-python/issues).\n\n## Examples in other langauges\n* [orca-lookup-node](https://github.com/orca-scan/orca-lookup-node)\n* [orca-lookup-dotnet](https://github.com/orca-scan/orca-lookup-dotnet)\n* [orca-lookup-go](https://github.com/orca-scan/orca-lookup-go)\n* [orca-lookup-php](https://github.com/orca-scan/orca-lookup-php)\n* [orca-lookup-java](https://github.com/orca-scan/orca-lookup-java)\n\n## History\n\nFor change-log, check [releases](https://github.com/orca-scan/orca-lookup-python/releases).\n\n## License\n\nLicensed under [MIT License](LICENSE) \u0026copy; Orca Scan, the [Barcode Scanner app for iOS and Android](https://orcascan.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forca-scan%2Forca-lookup-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forca-scan%2Forca-lookup-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forca-scan%2Forca-lookup-python/lists"}