← All guides

Build a keto meal planner with the Keto Recipe API

Pick recipes that fit a daily calorie and carb budget using the Keto Recipe API.

1. Get access

Subscribe to the free BASIC plan on the RapidAPI listing, then copy your key from the RapidAPI dashboard. Requests go to keto-diet.p.rapidapi.com.

2. Filter recipes

The recipes endpoint accepts these filters:

JavaScript (fetch)

const res = await fetch(
  'https://keto-diet.p.rapidapi.com/?calories__lt=500&carbohydrates_in_grams__lt=10',
  { headers: { 'x-rapidapi-key': 'YOUR_KEY', 'x-rapidapi-host': 'keto-diet.p.rapidapi.com' } }
);
const recipes = await res.json();
recipes.forEach(r => console.log(r.recipe, r.calories));

Python

import requests

resp = requests.get(
    'https://keto-diet.p.rapidapi.com/',
    params={'calories__lt': 500, 'carbohydrates_in_grams__lt': 10},
    headers={'x-rapidapi-key': 'YOUR_KEY', 'x-rapidapi-host': 'keto-diet.p.rapidapi.com'},
    timeout=10,
)
for recipe in resp.json():
    print(recipe['recipe'], recipe['calories'])

3. Build a day plan by category

Every recipe carries its category, so one low-carb query gives you the category ids. Then request one recipe per meal with category:

headers = {'x-rapidapi-key': 'YOUR_KEY', 'x-rapidapi-host': 'keto-diet.p.rapidapi.com'}
url = 'https://keto-diet.p.rapidapi.com/'

recipes = requests.get(url, params={'carbohydrates_in_grams__lt': 10}, headers=headers, timeout=10).json()
categories = {r['category']['id']: r['category']['category'] for r in recipes if r.get('category')}

plan = {}
for cat_id, name in categories.items():
    picks = requests.get(url, params={'category': cat_id, 'calories__lt': 600}, headers=headers, timeout=10).json()
    plan[name] = picks[0]['recipe'] if picks else None
print(plan)

Subscribe on RapidAPI Keto Recipe API details

Encurate Datasets