# How to Integrate Retool with Sprout Social

- Tool: Retool
- Difficulty: Intermediate
- Time required: 20 minutes
- Last updated: April 2026

## TL;DR

Connect Retool to Sprout Social using a REST API Resource with API key or OAuth authentication. Configure the base URL and auth header, then build queries to pull engagement analytics, profile performance data, and brand mention reports. The setup takes about 20 minutes and enables cross-platform social media analytics dashboards in Retool.

## Why Connect Retool to Sprout Social?

Sprout Social provides powerful analytics through its own reporting interface, but social media operations teams and marketing directors often need to combine Sprout data with other business metrics — CRM data, ad spend from Facebook Ads, web traffic from Google Analytics — in a single internal dashboard. Retool makes this possible by connecting to Sprout Social's API alongside other data sources, enabling unified reports that Sprout's native interface cannot produce.

The Sprout Social API exposes profile analytics, post performance, engagement data, and listening metrics through well-documented REST endpoints. Retool's query builder handles the HTTP configuration, authentication, and pagination visually, so marketing ops teams can build dashboards without writing API client code. Common use cases include executive social performance summaries that aggregate metrics across all brand accounts, competitor comparison panels using Sprout's listening data, and campaign performance trackers that link social engagement to downstream conversion events.

Beyond reporting, connecting Retool to Sprout Social enables operational workflows: surfacing unresolved messages that need agent response, tracking SLA compliance for engagement response times, and identifying high-engagement content for amplification. These operational views complement Sprout's native inbox and are especially useful for teams that manage social media at scale across multiple brands or client accounts.

## Before you start

- A Sprout Social account on a plan that includes API access (Advanced or higher)
- A Sprout Social API access token (generated from Sprout's developer settings or partner portal)
- A Retool account (Cloud or self-hosted) with permission to add Resources
- Basic familiarity with the Retool app builder — query editor, Tables, and Charts

## Step-by-step guide

### 1. Obtain a Sprout Social API access token

Sprout Social's API is available to customers on Advanced plans and above, as well as through Sprout's partner program. To obtain an access token, log in to your Sprout Social account and navigate to the developer or API settings area. Depending on your account type, you may find API credentials under Settings → API or through the Sprout Social Developer portal at developer.sproutsocial.com.

Sprout Social uses OAuth 2.0 for API authentication. For internal tool use cases like Retool dashboards, you can generate a long-lived API access token directly rather than implementing a full OAuth flow. In the developer settings, look for an option to create a Personal Access Token or generate an API key. Copy the access token and store it securely.

In Retool, navigate to Settings (gear icon in the left sidebar) → Configuration Variables. Create a new variable named SPROUT_ACCESS_TOKEN, paste your token as the value, and toggle the Secret switch to On. Secret variables are restricted to resource configurations and Workflows — they cannot be accessed by regular app users or exposed to the browser. Click Save. This secure storage pattern ensures your Sprout access token never appears in network requests visible to browser DevTools.

**Expected result:** A Sprout Social API access token is stored as a Secret Configuration Variable in Retool. You are ready to create the REST API Resource.

### 2. Create a Sprout Social REST API Resource in Retool

Navigate to the Retool home page and open the Resources tab from the top navigation or left sidebar. Click the Add Resource button in the top right. In the resource type selector, type 'REST API' in the search field or scroll to find it, then click REST API.

In the Name field, enter 'Sprout Social API'. In the Base URL field, enter the Sprout Social API base URL: https://api.sproutsocial.com/v1 — verify the current base URL and version path in Sprout Social's official API documentation, as version numbers can change.

In the Headers section, click Add header. Set Key to Authorization and Value to Bearer {{ retoolContext.configVars.SPROUT_ACCESS_TOKEN }}. The double curly brace syntax dynamically injects the token from the Configuration Variable at request time on Retool's server — the actual token value never reaches the browser. Add a second header: Key = Content-Type, Value = application/json. Add a third header: Key = Accept, Value = application/json.

Leave the authentication dropdown set to None since you are handling auth via the custom Authorization header. Click Save Changes. The Sprout Social API resource is now ready for use in Retool queries across all your apps.

**Expected result:** A 'Sprout Social API' REST API Resource is saved and visible in the Retool Resources list with the base URL and Bearer token header configured.

### 3. Build queries to fetch profile analytics and engagement data

Open or create a Retool app. In the Code panel at the bottom, click + New to create your first query. Name it getProfiles. Select your Sprout Social API resource. Set method to GET and path to /metadata/client. This retrieves all connected social profiles for your Sprout account, including their profile IDs which are needed for subsequent analytics queries. Set Trigger to run automatically on page load.

Create a second query named getProfileAnalytics. Resource = Sprout Social API, method = GET, path = /metrics/profiles. Add URL parameters: profiles[] = {{ profileSelect.value }} (referencing a Select component populated by getProfiles), start_time = {{ startDatePicker.value | ISO string }}, end_time = {{ endDatePicker.value | ISO string }}, fields = impressions,engagements,followers_gained,likes,comments,shares. Sprout's API uses bracket notation for array parameters. Set Trigger to run automatically when profileSelect or date picker values change.

Create a third query named getTopPosts. Resource = Sprout Social API, method = POST, path = /analytics/profiles/{profile_id}/posts. The POST body should include date range and metric filters for ranking posts by engagement. Set this to Manual trigger and add a filter for top posts by engagement count.

Create a fourth query named getListeningData. Resource = Sprout Social API, method = GET, path to the listening/mentions endpoint for your Sprout account, filtered by date range. These four queries cover the main analytics categories you will display.

```
// JavaScript transformer to format profile analytics for display
// Attach to getProfileAnalytics query (Advanced → Transform data)
const data_in = data;
if (!data_in || !data_in.data) return [];

return data_in.data.map(profile => {
  const impressions = profile.impressions_total || profile.impressions || 0;
  const engagements = profile.engagements_total || profile.engagements || 0;
  const engagementRate = impressions > 0
    ? ((engagements / impressions) * 100).toFixed(2) + '%'
    : 'N/A';
  const followersGained = profile.followers_gained || profile.net_follower_change || 0;

  return {
    profileId: profile.profile_id || profile.id,
    platform: profile.network_type || profile.network || 'Unknown',
    profileName: profile.name || profile.handle || 'Unknown Profile',
    impressions: impressions.toLocaleString(),
    engagements: engagements.toLocaleString(),
    engagementRate,
    followersGained: followersGained > 0 ? `+${followersGained}` : String(followersGained),
    period: profile.period || 'custom'
  };
});
```

**Expected result:** Four queries are configured: getProfiles returns connected social profiles, getProfileAnalytics returns engagement metrics for the selected profile and date range, getTopPosts returns high-performing content, and getListeningData returns brand mention data.

### 4. Build the social analytics dashboard UI

Assemble the dashboard interface. At the top of the canvas, add a Select component labeled 'Social Profile' populated with data from getProfiles: set Data source to {{ getProfiles.data.data }}, Label to {{ self.name || self.handle }}, Value to {{ self.profile_id }}. Add two Date Picker components for start and end dates. Place a Button labeled 'Load Analytics' that triggers all analytics queries simultaneously.

Drag four Stat components across the top of the canvas below the filters. Connect them to getProfileAnalytics data: Total Impressions, Total Engagements, Engagement Rate (calculated by transformer), and Followers Gained. Use the Value field with {{ }} expressions referencing the transformed query data.

Drag a Table component onto the main area. Set Data source to {{ getProfileAnalytics.data }} with the transformer applied. Configure columns for platform, profileName, impressions, engagements, engagementRate, and followersGained. Enable column sorting. This gives a multi-profile comparison view when multiple profiles are selected.

Drag a Chart component alongside the Table. Set type to Line. Create a transformer that reshapes getProfileAnalytics time-series data into the chart format: x-axis = date, series = one line per profile, y-axis = engagement rate. This shows engagement rate trends over the selected date range, making it easy to spot performance changes. For agencies managing 10+ client accounts requiring advanced cross-client reporting, RapidDev's team can help build multi-tenant Retool dashboards.

```
// Transformer for engagement rate line chart
// Creates time-series data for Chart component
const analytics = getProfileAnalytics.data;
if (!analytics || !analytics.data) return [];

// Assumes each item has a date field and engagement_rate
return analytics.data.map(item => ({
  date: item.date || item.period_start,
  profile: item.name || item.handle || item.profile_id,
  engagementRate: item.engagements_total && item.impressions_total
    ? parseFloat(((item.engagements_total / item.impressions_total) * 100).toFixed(2))
    : 0
}));
```

**Expected result:** The dashboard shows profile selector and date range filters at the top, Stat components with key metrics, a multi-profile comparison Table, and a line chart showing engagement rate trends over the selected period.

### 5. Add top posts analysis and brand mention monitoring

Add the top posts section to the dashboard. Drag a new Table component into a second tab or below the analytics section. Set Data source to {{ getTopPosts.data.data }}. Configure columns: post content (truncated to 80 chars using a transformer), platform icon, impressions, engagements, engagement rate, likes, comments, shares, and post date. Add a link column with the post URL so users can click through to view the original post on the social network.

Add a Button labeled 'Refresh Top Posts' that triggers getTopPosts on click. Enable sorting by engagement in the Table to immediately surface the best-performing content.

For the brand mentions section, drag a third Table and bind it to getListeningData. Configure columns: platform (with icon), author handle, mention content (truncated), sentiment (display as colored badge: green for positive, gray for neutral, red for negative), reach, and timestamp. Add filter Select components for platform and sentiment above the Table, using the filter() method in a transformer to filter rows based on the Select values.

Add an action column to the mentions Table with a 'Mark Reviewed' button that triggers a PATCH request to update the mention status in Sprout Social's API. Include an event handler that refreshes the mentions Table after a successful status update.

```
// Transformer for top posts with engagement calculation
// Attach to getTopPosts query
const posts = data;
if (!posts || !posts.data) return [];

return posts.data
  .map(post => ({
    id: post.id,
    content: post.text && post.text.length > 80
      ? post.text.substring(0, 80) + '...'
      : (post.text || '(no text)'),
    platform: post.network_type || post.network || 'Unknown',
    impressions: (post.impressions || 0).toLocaleString(),
    engagements: (post.engagements || 0).toLocaleString(),
    engagementRate: post.impressions > 0
      ? ((post.engagements / post.impressions) * 100).toFixed(2) + '%'
      : 'N/A',
    likes: post.likes || post.reactions || 0,
    comments: post.comments || 0,
    shares: post.shares || post.retweets || 0,
    postedAt: post.created_time
      ? new Date(post.created_time).toLocaleDateString()
      : 'Unknown',
    url: post.permalink || post.url || ''
  }))
  .sort((a, b) => (b.engagements || 0) - (a.engagements || 0));
```

**Expected result:** The top posts Table shows highest-engagement content with formatted metrics. The brand mentions Table displays recent mentions with sentiment badges and a filter for reviewing specific platforms or sentiment categories.

## Best practices

- Store your Sprout Social API access token in Retool Configuration Variables marked as Secret — this ensures the token is only accessible in resource configurations and never exposed to the browser or regular app users.
- Use date range pickers with sensible defaults (e.g., last 30 days) pre-populated so the dashboard immediately loads meaningful data without requiring manual date entry.
- Build profile selectors dynamically from getProfiles data rather than hard-coding profile IDs — this ensures the dashboard works correctly as social profiles are added or removed in Sprout.
- Add engagement rate calculations in JavaScript transformers rather than displaying raw impression and engagement counts — engagement rate is more meaningful for comparing performance across profiles with different audience sizes.
- Cache analytics queries for 15-30 minutes since social media metrics do not update in real time — frequent queries against Sprout's API for the same date ranges waste API calls and slow the dashboard.
- Use Retool's Tab component to organize analytics (impressions, engagements, growth), publishing (top posts, cadence), and listening (mentions, sentiment) into separate views so the dashboard remains focused.
- For agency use cases managing multiple client accounts, add a client selector as the top-level filter that drives all queries, and store client-to-profile mappings in a Retool Database or your own database.

## Use cases

### Build a cross-platform social performance dashboard

Create a Retool dashboard that queries Sprout Social for analytics across all connected profiles (Facebook, Instagram, Twitter/X, LinkedIn), displays key metrics (impressions, engagements, follower growth) in Stat components at the top, and shows a Chart comparing engagement rates across platforms over the past 30 days.

Prompt example:

```
Build a social analytics dashboard that shows monthly impressions, total engagements, and follower growth for each connected Sprout Social profile, with a line chart showing weekly engagement rate trends across all platforms and a table ranking top-performing posts by engagement.
```

### Monitor brand mentions and listening data in a management panel

Build a Retool dashboard that pulls Sprout Social's listening data for brand mentions, displays them in a Table with sentiment labels (positive, neutral, negative), volume over time in a Chart, and a filter for platform, sentiment, and date range. Add an action to mark mentions as reviewed or flag high-priority ones for response.

Prompt example:

```
Build a brand monitoring panel that shows recent Sprout Social brand mentions in a table with columns for platform, content preview, sentiment, reach, and date. Include a sentiment distribution pie chart and a button to flag a mention for review.
```

### Agency client reporting dashboard with multi-profile views

Create a Retool app where agency account managers select a client from a dropdown (mapped to a Sprout Social customer profile group), and the dashboard automatically loads that client's social performance data including impressions, follower growth, best-performing posts, and publishing cadence — enabling fast monthly report generation without navigating Sprout's native reports.

Prompt example:

```
Build an agency reporting dashboard with a client selector dropdown, where selecting a client loads their social analytics including total impressions, engagement rate, follower count change, and top 5 posts by engagement for the selected date range.
```

## Troubleshooting

### All API queries return 401 Unauthorized even with the access token configured

Cause: The Bearer token in the Authorization header is malformed, expired, or the token does not have the required permissions for the endpoints being accessed.

Solution: Verify the access token is still valid by testing a simple GET request in a REST client like Postman. If the token has expired, regenerate it in Sprout Social's developer settings. In the Retool resource configuration, confirm the Authorization header value is Bearer {{ retoolContext.configVars.SPROUT_ACCESS_TOKEN }} — check for missing spaces or extra characters. If Sprout Social uses short-lived tokens that need periodic refresh, implement a token refresh workflow using Retool Workflows on a schedule.

### Analytics queries return data but all metric values are zero

Cause: The profile IDs or date range parameters being passed to the analytics endpoint do not match the format expected by Sprout Social's API, resulting in valid responses with empty data sets.

Solution: Check the query Request tab in Retool to see the exact parameters being sent. Verify that profile IDs are in the correct format (numeric or UUID depending on Sprout's API version). Confirm date parameters are in the format Sprout expects (typically Unix timestamps or ISO 8601 strings). Log the raw response body to understand the data structure before applying transformers.

### getTopPosts query fails with 404 when the profile selector has no value selected

Cause: The profile_id is embedded in the URL path and evaluates to undefined or an empty string when no profile is selected, creating an invalid endpoint URL.

Solution: Add a conditional check before triggering the query: in the Button's event handler, wrap the trigger in a condition that checks {{ profileSelect.value !== '' && profileSelect.value !== undefined }}. Alternatively, set a default value on the profileSelect component using the first profile from getProfiles.data. Also consider using URL parameters instead of path parameters for profile filtering to make the fallback behavior more graceful.

## Frequently asked questions

### Does Retool have a native Sprout Social connector?

No. Retool does not include a dedicated Sprout Social connector. Integration is achieved by configuring the Sprout Social REST API as a generic REST API Resource in Retool's Resources tab. Once the base URL and Bearer token are set, all queries are built visually in Retool's query editor using the same interface as any other REST API integration.

### Which Sprout Social plan is required to access the API?

Sprout Social's API access is available on Advanced plan and above, as well as through their partner and developer programs. The Standard and Professional plans do not include direct API access. Check your current Sprout subscription or contact Sprout Social support to confirm API availability for your account. Enterprise customers may have custom API access terms.

### Can Retool post content to social media through Sprout Social's API?

Sprout Social's API does support post creation and scheduling endpoints. In Retool, you can build a form component where team members compose social content, select profiles and a schedule time, and submit the post to Sprout's API via a POST query. However, always test write operations thoroughly against a non-production Sprout account first — publishing incorrect content to live social profiles is immediately visible to followers.

### How does connecting Retool to Sprout Social differ from using Sprout's built-in reports?

Sprout Social's native reports are excellent for standalone social analytics but are isolated from other business data. Retool lets you combine Sprout data with your CRM (Salesforce, HubSpot), ad platform data (Facebook Ads, Google Ads), and internal databases in a single dashboard. This enables composite reports like 'social engagement vs. sales pipeline' or 'ad spend vs. organic reach' that Sprout's native interface cannot produce.

---

Source: https://www.rapidevelopers.com/retool-integrations/sprout-social
© RapidDev — https://www.rapidevelopers.com/retool-integrations/sprout-social
