## **🗺️ Overview**

If your Loveable site does not support the OTTO Pixel, you can still publish content directly from Search Atlas using the Search Atlas REST API. This guide walks you through the full workflow: generating your API key, retrieving your content, and posting it to your Loveable site programmatically.

## **🔑 Step 1: Generate Your Search Atlas API Key**

Before you can make any API calls, you need a valid API key from your Search Atlas account.

1. Log in to Search Atlas and go to your **Account Settings** (click your avatar in the top-right corner).
2. Navigate to the **API** or **Integrations** tab.
3. Click **Generate API Key**.
4. Copy the key and store it securely. You will not be able to view it again after leaving the page.

All API requests must include this key in the request header as **Authorization: Bearer YOUR\_API\_KEY**.

## **📄 Step 2: Retrieve Your Content from Search Atlas**

Once authenticated, use the content endpoint to fetch the article or page you want to publish.

**Endpoint:**

- **Method:** GET
- **URL:** https://api.searchatlas.com/v1/content/{content\_id}
- **Header:** Authorization: Bearer YOUR\_API\_KEY

Replace **{content\_id}** with the ID of the piece of content you want to publish. You can find the content ID in the URL when you open any article inside the Search Atlas platform.

**Example response fields you will use:**

- **title** — The page or article title.
- **body\_html** — The full HTML content of the article, ready to post.
- **meta\_description** — The SEO meta description.
- **slug** — The recommended URL slug for the page.

## **🌐 Step 3: Post the Content to Your Loveable Site**

Loveable supports custom content publishing through its own project API. You will use the content retrieved in Step 2 as the payload for your Loveable API call.

1. Log in to your Loveable account and open your project settings to locate your **Loveable Project API Key** and **Project ID**.
2. Construct a POST request to the Loveable content endpoint. The exact endpoint path is defined in your Loveable project's API documentation, but a typical structure is: **https://api.lovable.dev/projects/{project\_id}/pages**
3. Set the request headers to include both your Loveable API key and **Content-Type: application/json**.
4. Build the JSON body using the fields returned by Search Atlas in Step 2. A standard payload looks like this:

- **title:** value from Search Atlas **title** field
- **content:** value from Search Atlas **body\_html** field
- **slug:** value from Search Atlas **slug** field
- **meta\_description:** value from Search Atlas **meta\_description** field

Send the POST request. A successful response from Loveable will return a **201 Created** status and the URL of the newly published page.

## **🤖 Step 4: Automate the Workflow (Optional)**

If you want to publish content at scale without repeating these steps manually, you can automate the full pipeline using a tool like **Zapier**, **Make (formerly Integromat)**, or a custom script.

1. Set a trigger — for example, when a new article is marked as ready inside Search Atlas.
2. Use an HTTP action to call the Search Atlas GET endpoint and retrieve the content.
3. Map the response fields to a second HTTP action that posts to your Loveable project endpoint.
4. Log the Loveable response URL so you have a record of every published page.

This approach lets you publish dozens of pages without any manual copy-paste steps.

## **⚠️ Common Issues and Fixes**

- **401 Unauthorized:** Your API key is missing or incorrect. Double-check the Authorization header in both your Search Atlas and Loveable requests.
- **404 Not Found:** The content ID or Loveable project ID is wrong. Verify both values in their respective platform settings.
- **422 Unprocessable Entity:** A required field in the Loveable payload is missing or formatted incorrectly. Confirm that **title** and **content** are always included.
- **Content appears unstyled in Loveable:** Loveable may need you to link your site's CSS stylesheet separately from the content body. Check your Loveable theme settings.

## **💬 Need Help?**

If you need further assistance, open the chat widget in the bottom-right corner of the platform and type **human teammate** to be connected with a member of our team.