/bolt.new-ai-integrations

Bolt.new AI and Shutterstock API integration: Step-by-Step Guide 2025

Learn how to integrate Bolt.new AI with the Shutterstock API using our step‑by‑step guide for seamless creative automation and enhanced workflow.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to integrate Bolt.new AI with Shutterstock API?

 

Getting Your Shutterstock API Credentials

 

  • Sign up for a Shutterstock developer account at Shutterstock Developers and create a new app to obtain your API Key and API Secret.
  • Keep your API credentials handy as you will need them in your code to authenticate requests.

 

Creating a New File for Shutterstock Integration

 

  • In your Bolt.new project, create a new TypeScript file named shutterstock.ts.
  • This file will encapsulate all the functions required to interact with the Shutterstock API.
  • Copy and paste the following code snippet into shutterstock.ts:

/ Replace 'YOURSHUTTERSTOCKAPIKEY' and 'YOURSHUTTERSTOCKAPISECRET' with your actual credentials /
const APIKEY = 'YOURSHUTTERSTOCKAPIKEY';
const APISECRET = 'YOURSHUTTERSTOCKAPISECRET';

/**
- Function to search for images using the Shutterstock API.
- @param query - The search term.
- @returns Promise resolving to the JSON response.
 */
export async function searchShutterstockImages(query: string): Promise {
  const endpoint = https://api.shutterstock.com/v2/images/search?query=${encodeURIComponent(query)};

  // Create a Basic authentication header
  const credentials = btoa(${API_KEY}:${API_SECRET});
  const headers = {
    'Authorization': 'Basic ' + credentials,
    'Content-Type': 'application/json'
  };

  const response = await fetch(endpoint, { headers });
  if (!response.ok) {
    throw new Error('Shutterstock API request failed with status ' + response.status);
  }
  return await response.json();
}

/**
- Example usage:
- (async () => {
-   try {
-     const results = await searchShutterstockImages('nature');
-     console.log(results);
-   } catch (error) {
-     console.error(error);
-   }
- })();
 */

 

Integrating the Shutterstock Code into Your Bolt.new AI Project

 

  • Locate the main file (for example, index.ts or your primary TypeScript file) where you want to use Shutterstock API functionality.
  • Import the searchShutterstockImages function by adding the following import statement at the top of the file:

import { searchShutterstockImages } from './shutterstock';
  • Integrate the function call at the appropriate place in your code. For example, if you want to search for images based on user input, do something similar to the following:

async function handleImageSearch(query: string) {
  try {
    const results = await searchShutterstockImages(query);
    console.log('Search results:', results);
    // Process and display the results in your Bolt.new AI project UI as required.
  } catch (error) {
    console.error('Error fetching images from Shutterstock:', error);
  }
}

// Example trigger for the function, for demonstration:
handleImageSearch('landscape');

 

Handling Dependencies Without a Terminal

 

  • Bolt.new AI projects do not provide direct terminal access. If you need any external dependencies, add them as CDN links or use direct import statements if they are available as modules.
  • For this integration, the native fetch API is used, which is supported in modern environments. If you experience compatibility issues, consider adding a polyfill by including its script in your project’s HTML file.
  • No additional installation commands are needed since all dependencies are included directly in the code.

 

Testing Your Shutterstock Integration

 

  • Save all your changes in Bolt.new.
  • Run your project using the Run button in the Bolt.new interface.
  • Open the browser console to ensure the handleImageSearch function logs the Shutterstock API search results.
  • If any errors occur, verify that your API credentials are correct and that the API endpoint is reachable.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022