The Image API integration in DigiBlocks enhances your Image block functionality by allowing you to search and insert high-quality stock images directly from popular image providers. This feature streamlines your workflow by eliminating the need to leave the WordPress editor to find and download images.
Supported Image Providers
DigiBlocks supports integration with three major stock image providers:
- Unsplash – Over 4 million high-resolution photos
- Pexels – Curated collection of free stock photos
- Pixabay – Large library of photos, illustrations, and vectors
Each provider offers free API access with different rate limits and features.
Accessing Image API Settings
To configure your image API integration:
- Navigate to DigiBlocks > Settings in your WordPress admin dashboard
- Scroll down to the Image API Settings section
- Select your preferred image provider from the dropdown menu
- Configure the required credentials for your chosen provider
Configuring Unsplash Integration
Unsplash offers the largest collection of high-resolution photos with a generous free tier.
Getting Unsplash API Credentials
- Visit the Unsplash Developers website
- Click “Register as a developer” and create an account
- Once logged in, click “New Application”
- Fill out the application form with your website details
- Accept the API Guidelines and Terms
- After approval, you’ll receive your API credentials
Required Unsplash Fields
Application ID Enter the Application ID provided by Unsplash. This identifies your application to their API.
Access Key Your Unsplash Access Key is required for making API requests. This field is password-protected for security.
Secret Key (Optional) The Secret Key is only needed for advanced features and can be left empty for basic image search functionality.
Unsplash Rate Limits
The free Unsplash API tier provides:
- 50 requests per hour
- Access to the full Unsplash library
- High-resolution image downloads
Configuring Pexels Integration
Pexels provides curated stock photos with a simple API setup process.
Getting Pexels API Key
- Go to the Pexels API website
- Click “Get Started” and create a free account
- Verify your email address
- Navigate to your API dashboard
- Generate your API key
Required Pexels Fields
Pexels API Key Enter your Pexels API key in the password-protected field. This single key provides access to all Pexels API features.
Pexels Rate Limits
The free Pexels API tier offers:
- 200 requests per hour
- Access to curated photo collections
- Multiple image sizes available
Configuring Pixabay Integration
Pixabay offers the most generous rate limits and includes photos, illustrations, and vectors.
Getting Pixabay API Key
- Visit the Pixabay API Documentation
- Create a free Pixabay account if you don’t have one
- Log in to your account
- Navigate to the API section in your account settings
- Generate your API key
Required Pixabay Fields
Pixabay API Key Enter your Pixabay API key in the secured input field. This key provides access to their extensive media library.
Pixabay Rate Limits
The free Pixabay API tier provides:
- 5,000 requests per hour (highest among all providers)
- Access to photos, illustrations, and vectors
- Multiple file formats and sizes
Using Image Search in the Block Editor
Once your image API is configured:
- Add an Image block to your page or post
- In the block toolbar, look for the “Search Images” button
- Click the search button to open the image search interface
- Enter your search keywords
- Browse through the results from your configured provider
- Click on any image to insert it into your block
- The image will be automatically downloaded and added to your media library
Testing Your Configuration
To verify your API setup is working correctly:
- Create a new post or page
- Add an Image block
- Click the “Search Images” button
- Try searching for a common term like “nature” or “business”
- If images appear, your configuration is successful
- If no images appear, check your API credentials and try again
Security Considerations
API Key Protection All API keys are stored securely in your WordPress database and displayed as password fields in the admin interface to prevent accidental exposure.
Rate Limit Management DigiBlocks automatically handles API rate limits to prevent your keys from being temporarily suspended due to excessive requests.
Image Licensing All supported providers offer royalty-free images, but always verify the license terms for commercial use if applicable to your website.
Switching Between Providers
You can change your image provider at any time:
- Go to DigiBlocks > Settings
- Select a different provider from the Image API Provider dropdown
- Configure the new provider’s credentials
- Save your settings
- The change takes effect immediately for new image searches
Troubleshooting Common Issues
No Search Button Appears
- Ensure you have selected and configured an image API provider
- Verify your API credentials are entered correctly
- Check that the Image block is the active block
Search Returns No Results
- Verify your API keys are valid and active
- Check your internet connection
- Try different search terms
- Ensure you haven’t exceeded your API rate limits
Images Not Loading
- Confirm your server can make outbound HTTPS requests
- Check if your hosting provider blocks external API calls
- Verify your WordPress site has proper file upload permissions
API Rate Limit Exceeded
- Wait for your rate limit to reset (usually hourly)
- Consider upgrading to a paid API plan for higher limits
- Switch to a provider with higher rate limits if needed
Best Practices
Choose the Right Provider
- Use Unsplash for professional photography
- Choose Pexels for curated, high-quality images
- Select Pixabay for the highest rate limits and diverse content types
Optimize Your Searches
- Use specific keywords for better results
- Try alternative search terms if initial results aren’t suitable
- Consider the image orientation and subject matter for your content
Manage Your Usage
- Monitor your API usage to stay within rate limits
- Download and reuse images rather than searching repeatedly
- Consider caching frequently used images in your media library
The Image API integration significantly enhances your content creation workflow by providing instant access to professional stock imagery without leaving the WordPress editor.