---
updatedAt: 2025-06-16T23:32:28.000Z
agentTools:
  projectIndex: https://developer.duda.co/llms.txt
---

# Content Library API

The Content Library API returns data from your site's business info, text and images using Javascript. This article will walk you through how to use the API.

## Usage

The Content Library API needs to be initialized before data can be accessed.

```javascript JavaScript
const contentLib = await dmAPI.loadContentLibrary();
```

Once initialized, different object properties can be accessed directly. In the example below, we are accessing the primary location's address and custom site texts.

```javascript JavaScript
//access different areas of the Content Library
const address = contentLib.location_data.address;

const customTexts = contentLib.site_texts.custom

customTexts.forEach((siteText) => {
    console.log(`${siteText.label}: ${siteText.text}`)
})
```

## Content Library Object

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Property
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **location\_data**
        *object*
      </td>

      <td>
        Contains location-specific data for the primary location associated with a site.
      </td>
    </tr>

    <tr>
      <td>
        **additional\_locations**\
        *object*
      </td>

      <td>
        Contains location-specific data for any secondary/child locations associated with a site.
      </td>
    </tr>

    <tr>
      <td>
        **site\_texts**\
        *object*
      </td>

      <td>
        Contains the standard and custom text strings. Each field has a max length of 2000 characters.
      </td>
    </tr>

    <tr>
      <td>
        **business\_data**\
        *object*
      </td>

      <td>
        Contains the `name` of the business and the primary image `logo_url` of the website.
      </td>
    </tr>

    <tr>
      <td>
        **site\_images**\
        *object*
      </td>

      <td>
        Images that can be set and used within the design of the website. If you have the data, you should populate the alt value.
      </td>
    </tr>
  </tbody>
</Table>

Each of these object properties contains additional properties defined in the [Content Library Object](https://developer.duda.co/reference/site-content-content-library-object).