{"info":{"_postman_id":"96e78d38-7fc9-4c20-a314-fa06e5bceec8","name":"NutriScan AI API","description":"<html><head></head><body><h1 id=\"nutriscan-ai-api\">NutriScan AI API</h1>\n<p>NutriScan AI is a food analysis platform that helps users make informed dietary decisions by scanning and analysing food products using AI.</p>\n<h2 id=\"base-url\">Base URL</h2>\n<p><code>https://nutriscan-6okf.onrender.com/api</code></p>\n<blockquote>\n<p>Use the <code>https://nutriscan-6okf.onrender.com/api</code> collection variable to reference the base URL in all requests.</p>\n</blockquote>\n<h2 id=\"collection-variables\">Collection Variables</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Variable</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>baseUrl</code></td>\n<td>Base URL of the API: <code>https://nutriscan-6okf.onrender.com/api</code></td>\n</tr>\n<tr>\n<td><code>token</code></td>\n<td>JWT token set automatically after login</td>\n</tr>\n</tbody>\n</table>\n</div><h2 id=\"features\">Features</h2>\n<ul>\n<li><strong>User Management</strong> – Register, login, and manage user profiles with health conditions</li>\n<li><strong>Product Scanning</strong> – Search products by name, barcode, or browse featured items</li>\n<li><strong>AI Analysis</strong> – Get personalised nutritional analysis based on age group and health conditions</li>\n<li><strong>Product Comparison</strong> – Compare two food products side by side</li>\n<li><strong>History Tracking</strong> – Track scanned products and get daily nutritional summaries</li>\n</ul>\n<h2 id=\"authentication\">Authentication</h2>\n<p>Protected routes require a Bearer token in the <code>Authorization</code> header:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Authorization: Bearer your_jwt_here\n</code></pre><p>The token is obtained from the <strong>Login User</strong> endpoint and is automatically saved to the <code>token</code> collection variable by the test script.</p>\n<h2 id=\"session-based-routes\">Session-Based Routes</h2>\n<p>History routes use a session ID header:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>x-session-id: &lt;your-session-id&gt;\n</code></pre></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"NutriScan AI API","slug":"nutriscan-ai-api"}],"owner":"50839854","collectionId":"96e78d38-7fc9-4c20-a314-fa06e5bceec8","publishedId":"2sBXqKofJw","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-05-02T16:21:20.000Z"},"item":[{"name":"User","item":[{"name":"Register User","event":[{"listen":"test","script":{"id":"3524b110-6eb9-41b9-9269-0e51029c5cb7","exec":["pm.test('Status code is 200 or 201', function () {","    pm.expect(pm.response.code).to.be.oneOf([","        200,","        201","    ]);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response has user or token or message field', function () {","    const jsonData = pm.response.json();","    pm.expect(jsonData).to.satisfy(function (data) {","        return data.hasOwnProperty('user') || data.hasOwnProperty('token') || data.hasOwnProperty('message');","    });","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"40f818f0-8261-4037-b12e-bbe9e709fe46","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"name\": \"Harshit Kumar\",\n  \"email\": \"harshit1234@example.com\",\n  \"password\": \"123456a\"\n}","options":{"raw":{"language":"json"}}},"url":"https://nutriscan-6okf.onrender.com/api/user/register","description":"<p>Registers a new user on the NutriScan platform.</p>\n<p><strong>Method:</strong> POST<br /><strong>URL:</strong> <code>/api/user/register</code></p>\n<h3 id=\"request-body-json\">Request Body (JSON)</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>name</td>\n<td>string</td>\n<td>Yes</td>\n<td>Full name of the user</td>\n</tr>\n<tr>\n<td>email</td>\n<td>string</td>\n<td>Yes</td>\n<td>User's email address</td>\n</tr>\n<tr>\n<td>password</td>\n<td>string</td>\n<td>Yes</td>\n<td>Account password (min 6 characters)</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>Returns a success message and user details or token on successful registration.</p>\n<h3 id=\"example-request-body\">Example Request Body</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"name\": \"Harshit Kumar\",\n  \"email\": \"harshit1234@example.com\",\n  \"password\": \"123456a\"\n}\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","user","register"],"host":["nutriscan-6okf","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"40f818f0-8261-4037-b12e-bbe9e709fe46"},{"name":"Login User","event":[{"listen":"test","script":{"id":"589f0795-ac56-4baa-ae8b-89adc70a750a","exec":["pm.test('Status code is 200', function () {","    pm.response.to.have.status(200);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response has token field', function () {","    const jsonData = pm.response.json();","    pm.expect(jsonData).to.have.property('token');","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"bf017cbb-c422-4154-83a3-7cb70b5bd2fb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"email\": \"harshit@gmail.com\",\n  \"password\": \"123456\"\n}","options":{"raw":{"language":"json"}}},"url":"https://nutriscan-6okf.onrender.com/api/user/login","description":"<p>Authenticates an existing user and returns a JWT token.</p>\n<p><strong>Method:</strong> POST<br /><strong>URL:</strong> <code>/api/user/login</code></p>\n<h3 id=\"request-body-json\">Request Body (JSON)</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>email</td>\n<td>string</td>\n<td>Yes</td>\n<td>Registered email address</td>\n</tr>\n<tr>\n<td>password</td>\n<td>string</td>\n<td>Yes</td>\n<td>Account password</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>Returns a <code>token</code> which must be used as <code>Bearer your_jwt_here</code> in the Authorization header for protected routes.</p>\n<blockquote>\n<p>The test script automatically saves the token to the <code>token</code> collection variable via <code>pm.collectionVariables.set(\"token\", ...)</code>.</p>\n</blockquote>\n<h3 id=\"example-request-body\">Example Request Body</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"email\": \"harshit@gmail.com\",\n  \"password\": \"123456\"\n}\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","user","login"],"host":["nutriscan-6okf","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"bf017cbb-c422-4154-83a3-7cb70b5bd2fb"},{"name":"Get Profile","event":[{"listen":"test","script":{"id":"3e189ccb-a977-405f-a884-0a8742aeecfb","exec":["pm.test('Status code is 200', function () {","    pm.response.to.have.status(200);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response has name field', function () {","    const jsonData = pm.response.json();","    const data = jsonData.user || jsonData.profile || jsonData;","    pm.expect(data).to.have.property('name');","})","","pm.test('Response has email field', function () {","    const jsonData = pm.response.json();","    const data = jsonData.user || jsonData.profile || jsonData;","    pm.expect(data).to.have.property('email');","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"67201b47-5860-420d-b2fd-ee36d69806bf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[{"key":"Authorization","value":"Bearer your_jwt_here","type":"text"}],"url":"https://nutriscan-6okf.onrender.com/api/user/profile","description":"<p>Retrieves the authenticated user's profile information.</p>\n<p><strong>Method:</strong> GET<br /><strong>URL:</strong> <code>/api/user/profile</code></p>\n<h3 id=\"authentication\">Authentication</h3>\n<p>Uses Bearer token authentication. Set the <code>token</code> collection variable (auto-set after Login).</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Key</th>\n<th>Value</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Authorization</td>\n<td>Bearer your_jwt_here</td>\n<td>JWT token from login</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>Returns the user's profile including name, email, age group, BMI category, and health conditions.</p>\n","urlObject":{"protocol":"https","path":["api","user","profile"],"host":["nutriscan-6okf","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"67201b47-5860-420d-b2fd-ee36d69806bf"},{"name":"Update Profile","event":[{"listen":"test","script":{"id":"4b8f03a5-dab1-4016-88ad-2a247b5a1ccf","exec":["pm.test('Status code is 200', function () {","    pm.response.to.have.status(200);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response has success, message, or updated user data', function () {","    const jsonData = pm.response.json();","    pm.expect(jsonData).to.satisfy(function (data) {","        return data.hasOwnProperty('success') || data.hasOwnProperty('message') || data.hasOwnProperty('user') || data.hasOwnProperty('name');","    });","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"52f4f3d9-9a73-48d0-83b9-423f75c0afb7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer your_jwt_here","type":"text"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Harshit Updated\",\n  \"weight\": 72,\n  \"conditions\": [\"diabetes\"]\n}","options":{"raw":{"language":"json"}}},"url":"https://nutriscan-6okf.onrender.com/api/user/profile","description":"<p>Updates the authenticated user's profile details.</p>\n<p><strong>Method:</strong> PATCH<br /><strong>URL:</strong> <code>/api/user/profile</code></p>\n<h3 id=\"headers\">Headers</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Key</th>\n<th>Value</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Authorization</td>\n<td>Bearer your_jwt_here</td>\n<td>JWT token from login</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"request-body-json\">Request Body (JSON)</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>name</td>\n<td>string</td>\n<td>No</td>\n<td>Updated full name</td>\n</tr>\n<tr>\n<td>weight</td>\n<td>number</td>\n<td>No</td>\n<td>Updated weight in kg</td>\n</tr>\n<tr>\n<td>conditions</td>\n<td>array</td>\n<td>No</td>\n<td>Updated list of health conditions</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>Returns the updated user profile or a success message.</p>\n<h3 id=\"example-request-body\">Example Request Body</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"name\": \"Harshit Updated\",\n  \"weight\": 72,\n  \"conditions\": [\"diabetes\"]\n}\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","user","profile"],"host":["nutriscan-6okf","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"52f4f3d9-9a73-48d0-83b9-423f75c0afb7"}],"id":"d4b68c02-e77b-4a72-8aff-c7dbec2f35bb","description":"<h2 id=\"user-management\">User Management</h2>\n<p>Endpoints for user registration, authentication, and profile management.</p>\n<p>All profile endpoints require a valid Bearer token obtained from the Login endpoint.</p>\n","_postman_id":"d4b68c02-e77b-4a72-8aff-c7dbec2f35bb"},{"name":"Scan","item":[{"name":"Get Product by Barcode","event":[{"listen":"test","script":{"id":"f0458a4c-5b05-4753-9075-cfef0eed9883","exec":["pm.test('Status code is 200', function () {","    pm.response.to.have.status(200);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response has product data (name or barcode field)', function () {","    const jsonData = pm.response.json();","    const data = jsonData.product || jsonData;","    pm.expect(data).to.satisfy(function (d) {","        return d.hasOwnProperty('name') || d.hasOwnProperty('barcode');","    });","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"b524b73e-0750-47a4-b3d9-0cc4a05924c6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://nutriscan-6okf.onrender.com/api/scan/barcode?barcode=8992760223015","description":"<p>Retrieves product information using a product barcode number.</p>\n<p><strong>Method:</strong> GET<br /><strong>URL:</strong> <code>/api/scan/barcode</code></p>\n<h3 id=\"query-parameters\">Query Parameters</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>barcode</td>\n<td>string</td>\n<td>Yes</td>\n<td>The product barcode number (e.g. <code>8992760223015</code> for Oreo)</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>Returns product details including name, nutritional information, and ingredients.</p>\n","urlObject":{"protocol":"https","path":["api","scan","barcode"],"host":["nutriscan-6okf","onrender","com"],"query":[{"key":"barcode","value":"8992760223015"}],"variable":[]}},"response":[],"_postman_id":"b524b73e-0750-47a4-b3d9-0cc4a05924c6"},{"name":"Search Products","event":[{"listen":"test","script":{"id":"d559b66e-22e6-4db4-af32-151c6d624409","exec":["pm.test('Status code is 200', function () {","    pm.response.to.have.status(200);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response is array or has results/products field', function () {","    const jsonData = pm.response.json();","    pm.expect(jsonData).to.satisfy(function (data) {","        return Array.isArray(data) || data.hasOwnProperty('results') || data.hasOwnProperty('products');","    });","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"95617e43-68bc-45cb-9b10-16481dd53567","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://nutriscan-6okf.onrender.com/api/scan/search?q=kurkure","description":"<p>Searches for food products by name or keyword.</p>\n<p><strong>Method:</strong> GET<br /><strong>URL:</strong> <code>/api/scan/search</code></p>\n<h3 id=\"query-parameters\">Query Parameters</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>q</td>\n<td>string</td>\n<td>Yes</td>\n<td>Search query string (e.g. <code>kurkure</code>, <code>maggi</code>, <code>oreo</code>)</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>Returns a list of matching products with their basic details.</p>\n","urlObject":{"protocol":"https","path":["api","scan","search"],"host":["nutriscan-6okf","onrender","com"],"query":[{"key":"q","value":"kurkure"}],"variable":[]}},"response":[],"_postman_id":"95617e43-68bc-45cb-9b10-16481dd53567"},{"name":"Featured Products","event":[{"listen":"test","script":{"id":"140040c1-c2ad-46bd-9680-30db3a842373","exec":["pm.test('Status code is 200', function () {","    pm.response.to.have.status(200);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response is array or has products/featured field', function () {","    const jsonData = pm.response.json();","    pm.expect(jsonData).to.satisfy(function (data) {","        return Array.isArray(data) || data.hasOwnProperty('products') || data.hasOwnProperty('featured');","    });","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"0cfe250a-520f-4ded-93b9-418b8c5881ae","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://nutriscan-6okf.onrender.com/api/scan/featured","description":"<p>Returns a curated list of featured food products on the platform.</p>\n<p><strong>Method:</strong> GET<br /><strong>URL:</strong> <code>/api/scan/featured</code></p>\n<h3 id=\"response\">Response</h3>\n<p>Returns an array of featured products with their names, barcodes, and nutritional highlights.</p>\n","urlObject":{"protocol":"https","path":["api","scan","featured"],"host":["nutriscan-6okf","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"0cfe250a-520f-4ded-93b9-418b8c5881ae"}],"id":"e9e3bbaa-1c34-4246-a18c-ed2ae48ecda9","description":"<h2 id=\"product-scanning\">Product Scanning</h2>\n<p>Endpoints to discover and retrieve food product information by barcode, search query, or featured listings.</p>\n","_postman_id":"e9e3bbaa-1c34-4246-a18c-ed2ae48ecda9"},{"name":"Analyse","item":[{"name":"Analyse Product","event":[{"listen":"test","script":{"id":"1770f333-5561-4f1f-b59c-2f0222a62640","exec":["pm.test('Status code is 200', function () {","    pm.response.to.have.status(200);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response has analysis, result, score, or recommendation field', function () {","    const jsonData = pm.response.json();","    pm.expect(jsonData).to.satisfy(function (data) {","        return data.hasOwnProperty('analysis') || data.hasOwnProperty('result') || data.hasOwnProperty('score') || data.hasOwnProperty('recommendation');","    });","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"df911392-d7f5-440f-bbe1-82b5c640e062","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"product\": {\n    \"name\": \"Oreo\",\n    \"barcode\": \"8992760223015\",\n    \"ingredients_text\": \"Sugar, Unbleached Enriched Flour, Palm Oil, Cocoa, High Fructose Corn Syrup\",\n    \"per100g\": {\n      \"sugar_g\": 38,\n      \"fat_g\": 20,\n      \"sodium_mg\": 150,\n      \"calories_kcal\": 480,\n      \"protein_g\": 4,\n      \"fiber_g\": 2\n    }\n  },\n  \"ageGroup\": \"adult\",\n  \"conditions\": [\"diabetes\"]\n}\n","options":{"raw":{"language":"json"}}},"url":"https://nutriscan-6okf.onrender.com/api/analyse","description":"<p>Performs an AI-powered nutritional analysis of a food product, personalised based on the user's age group and health conditions.</p>\n<p><strong>Method:</strong> POST<br /><strong>URL:</strong> <code>/api/analyse</code></p>\n<h3 id=\"request-body-json\">Request Body (JSON)</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>product</td>\n<td>object</td>\n<td>Yes</td>\n<td>Product object with name, barcode, ingredients, and nutritional data</td>\n</tr>\n<tr>\n<td>product.name</td>\n<td>string</td>\n<td>Yes</td>\n<td>Product name</td>\n</tr>\n<tr>\n<td>product.barcode</td>\n<td>string</td>\n<td>No</td>\n<td>Product barcode number</td>\n</tr>\n<tr>\n<td>product.ingredients_text</td>\n<td>string</td>\n<td>No</td>\n<td>Comma-separated list of ingredients</td>\n</tr>\n<tr>\n<td>product.per100g</td>\n<td>object</td>\n<td>No</td>\n<td>Nutritional values per 100g</td>\n</tr>\n<tr>\n<td>product.per100g.calories_kcal</td>\n<td>number</td>\n<td>No</td>\n<td>Calories per 100g</td>\n</tr>\n<tr>\n<td>product.per100g.fat_g</td>\n<td>number</td>\n<td>No</td>\n<td>Fat in grams per 100g</td>\n</tr>\n<tr>\n<td>product.per100g.sugar_g</td>\n<td>number</td>\n<td>No</td>\n<td>Sugar in grams per 100g</td>\n</tr>\n<tr>\n<td>product.per100g.sodium_mg</td>\n<td>number</td>\n<td>No</td>\n<td>Sodium in milligrams per 100g</td>\n</tr>\n<tr>\n<td>product.per100g.protein_g</td>\n<td>number</td>\n<td>No</td>\n<td>Protein in grams per 100g</td>\n</tr>\n<tr>\n<td>product.per100g.fiber_g</td>\n<td>number</td>\n<td>No</td>\n<td>Fibre in grams per 100g</td>\n</tr>\n<tr>\n<td>ageGroup</td>\n<td>string</td>\n<td>Yes</td>\n<td>Age group: <code>child</code>, <code>adult</code>, or <code>senior</code></td>\n</tr>\n<tr>\n<td>conditions</td>\n<td>array</td>\n<td>No</td>\n<td>Health conditions e.g. <code>[\"diabetes\", \"hypertension\"]</code></td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>Returns a detailed AI analysis including nutritional score, health impact, and personalised recommendations.</p>\n<h3 id=\"example-request-body\">Example Request Body</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"product\": {\n    \"name\": \"Oreo\",\n    \"barcode\": \"8992760223015\",\n    \"ingredients_text\": \"Sugar, Unbleached Enriched Flour, Palm Oil, Cocoa, High Fructose Corn Syrup\",\n    \"per100g\": {\n      \"sugar_g\": 38,\n      \"fat_g\": 20,\n      \"sodium_mg\": 150,\n      \"calories_kcal\": 480,\n      \"protein_g\": 4,\n      \"fiber_g\": 2\n    }\n  },\n  \"ageGroup\": \"adult\",\n  \"conditions\": [\"diabetes\"]\n}\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","analyse"],"host":["nutriscan-6okf","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"df911392-d7f5-440f-bbe1-82b5c640e062"}],"id":"30609cce-bbcc-41aa-9441-efad93c0fc19","description":"<h2 id=\"ai-analysis\">AI Analysis</h2>\n<p>Endpoints to perform AI-powered nutritional analysis of food products, personalised based on the user's age group and health conditions.</p>\n","_postman_id":"30609cce-bbcc-41aa-9441-efad93c0fc19"},{"name":"Compare","item":[{"name":"Compare Products","event":[{"listen":"test","script":{"id":"2ae3cb23-cc18-4a29-af14-cd71bc6ce4a0","exec":["pm.test('Status code is 200', function () {","    pm.response.to.have.status(200);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response has comparison, result, product1, or product2 field', function () {","    const jsonData = pm.response.json();","    pm.expect(jsonData).to.satisfy(function (data) {","        return data.hasOwnProperty('comparison') || data.hasOwnProperty('result') || data.hasOwnProperty('product1') || data.hasOwnProperty('product2');","    });","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"04a5346e-8337-43c2-8f7a-aa4c87593315","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"product1\": {\n    \"name\": \"Kurkure\",\n    \"per100g\": {\n      \"sugar_g\": 3,\n      \"fat_g\": 34,\n      \"sodium_mg\": 800,\n      \"calories_kcal\": 560,\n      \"protein_g\": 6,\n      \"fiber_g\": 2\n    }\n  },\n  \"product2\": {\n    \"name\": \"Maggi\",\n    \"per100g\": {\n      \"sugar_g\": 1,\n      \"fat_g\": 14,\n      \"sodium_mg\": 1200,\n      \"calories_kcal\": 400,\n      \"protein_g\": 8,\n      \"fiber_g\": 1\n    }\n  },\n  \"ageGroup\": \"adult\"\n}\n","options":{"raw":{"language":"json"}}},"url":"https://nutriscan-6okf.onrender.com/api/compare","description":"<p>Compares two food products side by side with AI-powered insights personalised to the user's age group.</p>\n<p><strong>Method:</strong> POST<br /><strong>URL:</strong> <code>/api/compare</code></p>\n<h3 id=\"request-body-json\">Request Body (JSON)</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>product1</td>\n<td>object</td>\n<td>Yes</td>\n<td>First product with name and nutritional data</td>\n</tr>\n<tr>\n<td>product1.name</td>\n<td>string</td>\n<td>Yes</td>\n<td>Name of the first product</td>\n</tr>\n<tr>\n<td>product1.per100g</td>\n<td>object</td>\n<td>No</td>\n<td>Nutritional values per 100g for product 1</td>\n</tr>\n<tr>\n<td>product2</td>\n<td>object</td>\n<td>Yes</td>\n<td>Second product with name and nutritional data</td>\n</tr>\n<tr>\n<td>product2.name</td>\n<td>string</td>\n<td>Yes</td>\n<td>Name of the second product</td>\n</tr>\n<tr>\n<td>product2.per100g</td>\n<td>object</td>\n<td>No</td>\n<td>Nutritional values per 100g for product 2</td>\n</tr>\n<tr>\n<td>ageGroup</td>\n<td>string</td>\n<td>Yes</td>\n<td>Age group: <code>child</code>, <code>adult</code>, or <code>senior</code></td>\n</tr>\n</tbody>\n</table>\n</div><p>The <code>per100g</code> object for each product supports: <code>sugar_g</code>, <code>fat_g</code>, <code>sodium_mg</code>, <code>calories_kcal</code>, <code>protein_g</code>, <code>fiber_g</code>.</p>\n<h3 id=\"response\">Response</h3>\n<p>Returns a comparison of both products including nutritional scores, pros/cons, and a recommendation on which is healthier.</p>\n<h3 id=\"example-request-body\">Example Request Body</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"product1\": {\n    \"name\": \"Kurkure\",\n    \"per100g\": { \"sugar_g\": 3, \"fat_g\": 34, \"sodium_mg\": 800, \"calories_kcal\": 560, \"protein_g\": 6, \"fiber_g\": 2 }\n  },\n  \"product2\": {\n    \"name\": \"Maggi\",\n    \"per100g\": { \"sugar_g\": 1, \"fat_g\": 14, \"sodium_mg\": 1200, \"calories_kcal\": 400, \"protein_g\": 8, \"fiber_g\": 1 }\n  },\n  \"ageGroup\": \"adult\"\n}\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","compare"],"host":["nutriscan-6okf","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"04a5346e-8337-43c2-8f7a-aa4c87593315"}],"id":"3a139f67-dbde-459a-9013-b056959235cc","description":"<h2 id=\"product-comparison\">Product Comparison</h2>\n<p>Endpoints to compare two food products side by side, with personalised insights based on age group.</p>\n","_postman_id":"3a139f67-dbde-459a-9013-b056959235cc"},{"name":"History","item":[{"name":"Get History","event":[{"listen":"test","script":{"id":"92bb064d-fde9-41a5-b42c-f0e44d7d2384","exec":["pm.test('Status code is 200', function () {","    pm.response.to.have.status(200);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response is array or has history/items field', function () {","    const jsonData = pm.response.json();","    pm.expect(jsonData).to.satisfy(function (data) {","        return Array.isArray(data) || data.hasOwnProperty('history') || data.hasOwnProperty('items');","    });","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"4da8eb42-ca6e-499b-8cb7-2f58f1588a4c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"x-session-id","value":"test-session-123","type":"text"}],"url":"https://nutriscan-6okf.onrender.com/api/history","description":"<p>Retrieves the scan history for the current session.</p>\n<p><strong>Method:</strong> GET<br /><strong>URL:</strong> <code>/api/history</code></p>\n<h3 id=\"headers\">Headers</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Key</th>\n<th>Value</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>x-session-id</td>\n<td>test-session-123</td>\n<td>Unique session identifier</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>Returns a list of previously scanned products for the session, including timestamps and product details.</p>\n","urlObject":{"protocol":"https","path":["api","history"],"host":["nutriscan-6okf","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"4da8eb42-ca6e-499b-8cb7-2f58f1588a4c"},{"name":"Daily Summary","event":[{"listen":"test","script":{"id":"dd612051-37d1-4b36-bb12-00666a6f58b5","exec":["pm.test('Status code is 200', function () {","    pm.response.to.have.status(200);","})","","pm.test('Response time is acceptable', function () {","    pm.expect(pm.response.responseTime).to.be.below(10000);","})","","pm.test('Response is JSON', function () {","    pm.response.to.be.json;","})","","pm.test('Response has summary, date, or nutrition data', function () {","    const jsonData = pm.response.json();","    pm.expect(jsonData).to.satisfy(function (data) {","        return data.hasOwnProperty('summary') || data.hasOwnProperty('date') || data.hasOwnProperty('nutrition') || data.hasOwnProperty('calories');","    });","})"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"944cfc34-8e44-470c-9c76-e47b18948b46","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"x-session-id","value":"test-session-123","type":"text"}],"url":"https://nutriscan-6okf.onrender.com/api/history/daily-summary","description":"<p>Returns a daily nutritional summary based on the products scanned in the current session.</p>\n<p><strong>Method:</strong> GET<br /><strong>URL:</strong> <code>/api/history/daily-summary</code></p>\n<h3 id=\"headers\">Headers</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Key</th>\n<th>Value</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>x-session-id</td>\n<td>test-session-123</td>\n<td>Unique session identifier</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>Returns aggregated nutritional data for the day including total calories, macronutrients, and health insights based on scanned products.</p>\n","urlObject":{"protocol":"https","path":["api","history","daily-summary"],"host":["nutriscan-6okf","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"944cfc34-8e44-470c-9c76-e47b18948b46"}],"id":"3b73717c-bae1-4c4b-a407-091c8745bd67","description":"<h2 id=\"scan-history\">Scan History</h2>\n<p>Endpoints to retrieve the user's product scan history and daily nutritional summaries. Identified by a session ID passed in the <code>x-session-id</code> header.</p>\n","_postman_id":"3b73717c-bae1-4c4b-a407-091c8745bd67"}],"event":[{"listen":"prerequest","script":{"id":"73b9eba3-b906-4b50-816e-81b10d693b18","type":"text/javascript","packages":{},"requests":{},"exec":[""]}},{"listen":"test","script":{"id":"3c464016-3865-454b-9b20-02d94cd2f078","type":"text/javascript","packages":{},"requests":{},"exec":[""]}}],"variable":[{"key":"baseUrl","value":"https://nutriscan-6okf.onrender.com/api"},{"key":"token","value":"your_jwt_here"}]}