This guide explains how to extract JSON data from the search component of a CMS in Framer. This method is unofficial and involves using the browser's developer tools to access the search index data. It's important to note that this method is not officially supported by Framer, and the structure of the data may change without notice.
- A website built with Framer that includes a search component.
- Basic understanding of web browsers and using developer tools.
-
Add a Search Component to Your Framer Site
- Edit your site in Framer and add a search component to any page. This component is necessary to trigger the creation of the search index.
-
Publish Your Site
- Once the search component is added, publish your site to make it live (You could just preview as well if you already published your site in the past). This step is crucial as the search index is generated for the live site.
-
Visit Your Live Site
- Open a web browser and go to the URL of your live Framer site.
-
Trigger the Search Component
- Interact with the search component on your site. This can be done by entering a search query or simply clicking on the search field to activate it.
-
Open Browser Developer Tools
- Right-click on any part of the web page and select
Inspectto open the browser's developer tools. Alternatively, you can use keyboard shortcuts likeCtrl+Shift+I(Windows/Linux) orCmd+Opt+I(Mac).
- Right-click on any part of the web page and select
-
Navigate to the Network Tab
- In the developer tools, find and click on the
Networktab. This tab shows all network requests made by the page.
- In the developer tools, find and click on the
-
Find the
searchIndexRequest- With the Network tab open, look for a network request named something like
searchIndex. This request is responsible for fetching the search data. - You might need to refresh the page and interact with the search component again to see this request.
- With the Network tab open, look for a network request named something like
-
Copy the Request URL
- Click on the
searchIndexrequest to view its details. - Find and copy the Request URL. This URL is the direct link to the JSON file containing the search index data.
- Click on the
-
Access and Save the JSON Data
- Paste the copied URL into a new browser tab and press Enter. This should display the JSON data.
- Right-click on the page and select
Save asto download the JSON file. - Alternatively, you can copy the JSON data and save it in a text editor as a
.jsonfile.
- Storing the JSON Data: Since this is an unofficial method, it's recommended to store a copy of the JSON file. This ensures you have a stable version of the data, as the original source might change unexpectedly.
- Usage Considerations: Be mindful of how you use this data. Since this method is not officially supported, it may not comply with Framer's terms of service.
- Check for Updates: Regularly check if Framer has introduced any official API or changes that might affect this method.