FOR DEVELOPERS
Website feeds and API
Bring selected Instagram media to your website with a server-side integration.
Create a selected-media feed
Only the media you selected is refreshed. Future posts are not added automatically. Deleting the feed or disconnecting the Instagram account makes its endpoint unavailable.
- Connect your Instagram account, then open Feed in the Reflect dashboard.
- Name the feed and select 1–50 owned posts or reels.
- Select Create feed, then copy the feed ID or endpoint.
- Open Developer, create a read-only API key, and save the displayed secret immediately.
Call it from your server
Set REFLECT_API_KEY on your website’s server and use your actual feed ID in the endpoint. Keep the key out of client-side JavaScript, public repositories, and URLs. An API key can read only feeds belonging to its owner.
// Server-side JavaScript only
const feedId = 'your-feed-id';
const response = await fetch(
`https://reflectapi.varcbytes.com/public/feed/${feedId}`,
{ headers: { 'X-API-Key': process.env.REFLECT_API_KEY } }
);
if (!response.ok) {
throw new Error(`Feed request failed: ${response.status}`);
}
const { data } = await response.json();
const feed = data.feed;
// Cache feed until feed.nextRefreshAt.
// Render captions as text, not HTML.Refresh and rendering
The response includes the selected media, available captions, URLs, types, permalinks, refreshedAt, and nextRefreshAt. Fields can be absent or null when Instagram does not provide them. Videos and carousels need rendering appropriate to their media types.
Cache the JSON on your server until nextRefreshAt. Refresh timing depends on the account plan. The API returns stored snapshots; it does not fetch fresh Instagram data for every website request. Instagram-hosted media URLs are not a permanent mirror of the files.
Keys, limits, and errors
Keys are read-only and owner-bound. Rate limits apply per key and across an account. Revoke a compromised key in Developer and issue a replacement. Do not rotate keys to evade limits.
- 401: a key is missing, invalid, expired, or revoked.
- 404: the feed is unavailable or belongs to a different account.
- 429 or a temporary key block: honor Retry-After and stop retrying until allowed.
- 503: the service is temporarily unavailable; retry with backoff.