Skip to content
FoodPhoto.ai
← Back to Developer Hub

SDKs & Code Libraries

Official client libraries for popular programming languages. Type-safe, well-documented, and maintained by the FoodPhoto.ai team.

🟨

JavaScript / Node.js

v2.1.0

Stable
Install
npm install @foodphoto/sdk# or: yarn add @foodphoto/sdk
Full TypeScript support with types included
Works in Node.js and browser (with bundler)
Promise-based async/await API
Automatic retry with exponential backoff
File upload from local path or URL
🐍

Python

v1.5.2

Stable
Install
pip install foodphoto# or: poetry add foodphoto
Type hints for autocomplete in modern IDEs
Works with Python 3.8+
Sync and async support (asyncio)
Upload from file path, bytes, or URL
Built-in error handling and logging
🐘

PHP

v1.2.0

Stable
Install
composer require foodphoto/sdk
Compatible with PHP 7.4+
PSR-4 autoloading
Guzzle HTTP client included
Exception-based error handling
Laravel service provider available
💎

Ruby

v1.1.0

Beta
Install
gem install foodphoto# or: gem 'foodphoto' # in Gemfile
Ruby 2.7+ and Ruby 3.x support
Idiomatic Ruby API design
Works with Rails and Sinatra
Upload from File object or URL
Detailed error messages

Quick start examples

Get up and running in minutes with these code examples

JavaScript
import { FoodPhotoClient } from '@foodphoto/sdk';

const client = new FoodPhotoClient({
  apiKey: process.env.FOODPHOTO_API_KEY
});

// Enhance a photo from URL
const result = await client.photos.enhance({
  imageUrl: 'https://example.com/burger.jpg',
  preset: 'delivery-optimized'
});

console.log(result.enhanced.square);
// https://cdn.foodphoto.ai/...
Python
from foodphoto import FoodPhotoClient

client = FoodPhotoClient(
    api_key=os.environ['FOODPHOTO_API_KEY']
)

# Enhance a photo from local file
result = client.photos.enhance(
    image_path='./burger.jpg',
    preset='delivery-optimized'
)

print(result.enhanced.square)
# https://cdn.foodphoto.ai/...
PHP
use FoodPhoto\Client;

$client = new Client([
    'apiKey' => getenv('FOODPHOTO_API_KEY')
]);

// Enhance a photo from URL
$result = $client->photos->enhance([
    'imageUrl' => 'https://example.com/burger.jpg',
    'preset' => 'delivery-optimized'
]);

echo $result->enhanced->square;
// https://cdn.foodphoto.ai/...
cURL
curl -X POST https://api.foodphoto.ai/v1/photos/enhance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "imageUrl": "https://example.com/burger.jpg",
    "preset": "delivery-optimized"
  }'

Postman Collection

Test our API in Postman with pre-configured requests for all endpoints. Includes examples, authentication, and environment variables.

Advanced SDK features

Production-ready features built into every SDK

Auto-retry

Automatic retry with exponential backoff for transient errors

Type safety

Full TypeScript types and IDE autocomplete support

Well documented

Inline documentation and comprehensive guides

Ready to start coding?

Get your API key and install your favorite SDK

Need help? Email [email protected]

SDKs & Libraries | FoodPhoto.ai Developer Tools