← 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.
🟨
StableJavaScript / Node.js
v2.1.0
Install
npm install @foodphoto/sdk# or: yarn add @foodphoto/sdkFull 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
🐍
StablePython
v1.5.2
Install
pip install foodphoto# or: poetry add foodphotoType 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
🐘
StablePHP
v1.2.0
Install
composer require foodphoto/sdkCompatible with PHP 7.4+
PSR-4 autoloading
Guzzle HTTP client included
Exception-based error handling
Laravel service provider available
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]