{
  "openapi": "3.0.3",
  "info": {
    "title": "Edamam API testing Ph-1 Nov 2026 recipe scoring API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://edamam-ph1.api.diirecipes.com"
    }
  ],
  "paths": {
    "/score": {
      "post": {
        "summary": "Score and save a recipe",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "recipe_id",
                  "name",
                  "servingsize",
                  "ingredients"
                ],
                "properties": {
                  "recipe_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "servingsize": {
                    "oneOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "exclusiveMinimum": true
                      },
                      {
                        "type": "string",
                        "description": "Numeric value greater than zero"
                      }
                    ]
                  },
                  "ingredients": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 300,
                    "items": {
                      "type": "object",
                      "required": [
                        "food_id",
                        "quantity",
                        "unit"
                      ],
                      "properties": {
                        "food_id": {
                          "type": "string",
                          "description": "NDSR food ID from the supplied food catalog."
                        },
                        "quantity": {
                          "oneOf": [
                            {
                              "type": "number",
                              "minimum": 0
                            },
                            {
                              "type": "string",
                              "description": "Decimal value >= 0"
                            }
                          ],
                          "description": "Amount in the selected unit."
                        },
                        "unit": {
                          "type": "string",
                          "description": "Unit ID as a string: 1 = Teaspoon; 2 = Tablespoon; 3 = Ounce; 4 = Cup; 5 = Pint; 6 = Quart; 7 = Gallon; 8 = Dash; 9 = Smidgen; 10 = Drop; 11 = Pinch; 12 = Pounds; 13 = Grams; 14 = Kilogram."
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "recipe_id": "recipe-001",
                "name": "Example recipe",
                "servingsize": 6,
                "ingredients": [
                  {
                    "food_id": "1231",
                    "quantity": "2400",
                    "unit": "13"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scoring result"
          },
          "201": {
            "description": "Recipe saved"
          },
          "400": {
            "description": "Invalid recipe"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient scope or inactive project"
          },
          "409": {
            "description": "Recipe already exists"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "500": {
            "description": "Scoring failed"
          },
          "502": {
            "description": "Scoring unavailable"
          },
          "503": {
            "description": "Scorer configuration unavailable"
          },
          "504": {
            "description": "Gateway timeout"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
