Install Dictionary SDK
Add the Dictionary SDK to your project in under 30 seconds. Supports Node.js, Python, PHP, Java, and more.
Install via Package Manager
Select your language or platform to see the installation command:
Verify installation by checking your package.json dependencies.
Requires Python 3.9 or higher. We recommend using a virtual environment for development.
https://api.dictionary.com/v2/lookup?word=hello \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Great for prototyping, CI/CD scripts, or serverless environments without package managers.
Compatible with PHP 8.0+. Supports Laravel, Symfony, and vanilla PHP setups.
Supports Java 11+ and is fully compatible with Spring Boot, Quarkus, and Micronaut.
Configure & Initialize
After installation, initialize the client with your API key. We recommend using environment variables for security.
-
Set your API Key
Export your key in your environment or add it to your
.envfile:.envDICTIONARY_API_KEY="sk_test_51abc123def456..." DICTIONARY_ENV="development" -
Instantiate the Client
Import and initialize the SDK in your entry point:
JavaScriptimport { Dictionary } from '@dictionary/sdk'; import { config } from 'dotenv'; config(); const dictionary = new Dictionary({ apiKey: process.env.DICTIONARY_API_KEY, timeout: 5000, retries: 2 }); // Test connection const health = await dictionary.health(); console.log(`SDK Status:`, health.status); // "connected"
Troubleshooting
npm install or clear your cache with npm cache clean --force if the package fails to resolve.
sk_test_ and production keys with sk_live_.