main Veganify Logo

Veganify API Overview

Stablev0.3.1Public version

The public version of the API misses the following (essential) files:

Requirements

Develop locally

Start the NestJS server locally with the following command:

Start the service

npm install
npm run start:dev 

Debug the service

npm install
npm run start:debug

Run PETA Cronjob manually

npm run get:peta

Build and deploy

Build the service

npm install
npm run build
npm run start
Ideally deploy the API with the Dockerfile included in the project.

OpenAPI specification

Newest version in the repo
The version in the repo gets updated more frequently.
Open in repo
Version 29/08/23
Read the version from 29/08/23 here.
openapi: 3.0.0
          paths:
            /v0/grades/backend:
              post:
                operationId: GradesController_checkBarcode
                parameters: []
                requestBody:
                  required: true
                  description: The barcode to be checked
                  content:
                    application/json:
                      schema:
                        $ref: '#/components/schemas/BarcodeDto'
                responses:
                  '201':
                    description: Request returned a positive result.
                    content:
                      application/json:
                        schema:
                          $ref: '#/components/schemas/backendResponseDto'
                  '400':
                    description: Input Error / Bad Request.
                  '500':
                    description: Internal Server Error.
                tags:
                  - Grades
            /v0/ingredients/{ingredients}:
              get:
                operationId: IngredientsController_getIngredients
                parameters:
                  - name: ingredients
                    required: true
                    in: path
                    schema:
                      type: string
                  - name: translate
                    required: true
                    in: query
                    schema:
                      type: boolean
                responses:
                  '200':
                    description: Request returned a positive result.
                  '500':
                    description: Internal Server Error.
                  '503':
                    description: >-
                      Service Unavailable. Translation service is unavailable. Try again
                      with disabled translation (Results might vary). Add flag
                      ?translate=false to the request.
                tags:
                  - Ingredients
            /v0/product/{barcode}:
              post:
                operationId: ProductController_getProductDetails
                parameters:
                  - name: barcode
                    required: true
                    in: path
                    schema:
                      type: string
                responses:
                  '200':
                    description: Request returned a positive result.
                  '400':
                    description: Input Error / Bad Request.
                  '404':
                    description: Specified product is not in the database.
                  '500':
                    description: Internal Server Error.
                tags:
                  - Product Information
            /v0/peta/{type}:
              get:
                operationId: PetaController_getPetaByType
                parameters:
                  - name: type
                    required: true
                    in: path
                    schema:
                      type: string
                responses:
                  '200':
                    description: Request returned a positive result.
                  '400':
                    description: Input Error / Bad Request.
                  '404':
                    description: Specified tyoe is not available.
                  '500':
                    description: Internal Server Error.
                tags:
                  - Peta
          info:
            title: Veganify API
            description: API for checking if products and ingredients are vegan
            version: 0.3.1
            contact:
              name: FrontendNetwork
              url: https://veganify.app
              email: info@philip.media
            license:
              name: MIT
              url: https://opensource.org/licenses/MIT
          tags: []
          servers:
            - url: https://api.veganify.app
              description: Production server
            - url: https://api.staging.veganify.app
              description: Staging server
          components:
            schemas:
              BarcodeDto:
                type: object
                properties:
                  barcode:
                    type: string
                    description: The barcode to be checked
                    example: '4066600204404'
                required:
                  - barcode
              backendResponseDto:
                type: object
                properties:
                  barcode:
                    type: string
                    description: The barcode requested
                    example: '12345678'
                  name:
                    type: string
                    description: The name of the product
                    example: Paulaner Spezi Zero
                  grade:
                    type: string
                    description: The grade of the product
                    example: B
                required:
                  - barcode
                  - name
                  - grade
          externalDocs:
            description: Veganify API Documentation
            url: https://frontendnet.work/veganify-api
          

Endpoints

All endpoints are only accessible via HTTPS.

Available endpoints

The following endpoints are available within the veganify.app API:

Unavailable endpoints

The following endpoints are currently unavailable within the veganify.app API:

API documentation

The API documentation can be found at one of the following locations: