# Instagram Trending Scraper (`agentx/instagram-trending-scraper`) Actor

Unofficial Instagram Explore scraper for public posts and reels by country, with section and topic labels, captions, engagement metrics, creator, location, comments, audio, and automatically archived images and videos. Not affiliated with Instagram or Meta.

- **URL**: https://apify.com/agentx/instagram-trending-scraper.md
- **Developed by:** [AgentX](https://apify.com/agentx) (community)
- **Categories:** Social media, AI, Agents
- **Features:** Limited permissions
- **Stats:** 638 total users, 87 monthly users, 100.0% runs succeeded, 15 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.93 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

**Instagram Trending Scraper is an instagram trending scraper that collects localized public Explore posts, videos, and carousels and returns 62 structured fields with archived media.** It is built for trend research that starts from Instagram Explore rather than a known profile, hashtag, or post URL.

[![Apify Users](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.apify.com%2Fv2%2Facts%2Fagentx~instagram-trending-scraper\&query=%24.data.stats.totalUsers\&label=Apify%20Users\&color=ff9013\&style=for-the-badge)](https://apify.com/agentx/instagram-trending-scraper) [![Apify Runs](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.apify.com%2Fv2%2Facts%2Fagentx~instagram-trending-scraper\&query=%24.data.stats.totalRuns\&label=Apify%20Runs\&color=ff9013\&style=for-the-badge)](https://apify.com/agentx/instagram-trending-scraper) [![$0.0039 / result](https://img.shields.io/badge/%240.0039%20%2F%20result-4285f4?style=for-the-badge)](https://apify.com/agentx/instagram-trending-scraper/pricing) [![35 content locales](https://img.shields.io/badge/35%20content%20locales-34a853?style=for-the-badge)](https://console.apify.com/actors/bUkw01H4rn1K9brjp/input) [![API + MCP ready](https://img.shields.io/badge/API%20%2B%20MCP%20ready-fbbc05?style=for-the-badge)](https://apify.com/agentx/instagram-trending-scraper/api)

- **35 locale choices** map directly to the `Accept-Language` header used for Explore discovery.
- **62 declared Dataset fields** cover topics, identity, captions, engagement, media, locations, relationships, audio, and provenance.
- **Images and videos are archived automatically** and returned through Actor storage URLs on completed rows.
- **Pay-per-event billing** charges one Actor Start and one Result for each row written to the default Dataset.

The smallest useful run requests one United States result and has a maximum configured FREE-tier event total of `$0.01390`: `$0.01` Actor Start plus one `$0.00390` Result.

### Why Choose Instagram Trending Scraper

Instagram Trending Scraper provides a current Explore snapshot with source-supplied taxonomy and media instead of requiring a manually reviewed Explore screen.

- **Explore context** returns `explore_section` and `explore_topic` beside every post.
- **Post evidence** includes stable IDs, canonical URLs, captions, publication time, and engagement snapshots.
- **Creator and relationship context** includes owner identity, tagged users, coauthors, pin state, and public location signals.
- **Media-ready output** normalizes images, videos, and carousels into `media_items` and archives completed assets.
- **Honest localization** records the requested locale and exact language header without claiming national ranking or IP geolocation.

[Meta explains that Instagram recommendations personalize over time](https://about.fb.com/news/2024/11/introducing-recommendations-reset-instagram/). Treat each Dataset as a run-specific public Explore snapshot, not an official universal or country chart.

### Quick Start Guide

The prefilled input is a one-result United States liveness test.

#### Configure

Keep `max_results` at `1` and choose `United States` or another one of the 35 content locales.

#### Run

Start the Actor and wait for the terminal `Returned` status. `max_results` is a successful-row cap, so source or media availability can produce fewer rows.

#### Collect

Open the default Dataset for JSON, CSV, Excel, API, webhook, or integration delivery. Media URLs on completed rows point to Actor storage.

### Input Parameters

The Actor has exactly two required inputs, in schema order.

| Parameter | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `max_results` | integer, minimum 1 | Yes | Maximum successfully published Explore rows in this run. | `1` |
| `country` | string enum, 35 values | Yes | Country-style locale used to build the Instagram `Accept-Language` header; not an IP geolocation or origin filter. | `United States` |

```json
{
  "max_results": 1,
  "country": "United States"
}
```

All 35 values are valid runtime paths. A fresh all-locale check returned data for every option, but overlapping posts are expected because the source remains one public Explore experience.

### Output Data Schema

One Dataset row represents one completed public Explore post with locale context, source facts, and archived media; unavailable source values stay `null` or empty.

| Group | Fields |
| --- | --- |
| Request and Explore | `platform`, `requested_country`, `requested_accept_language`, `explore_section`, `explore_topic` |
| Post identity | `post_id`, `shortcode`, `post_url`, `post_type`, `product_type`, `media_type` |
| Owner | `owner_id`, `owner_username`, `owner_name`, `owner_url`, `owner_verified`, `owner_avatar` |
| Caption and time | `caption`, `caption_translation`, `caption_created_at`, `caption_edited`, `alt_text`, `hashtags`, `mentions`, `published_at` |
| Engagement | `like_count`, `comment_count`, `view_count`, `counts_hidden` |
| Media | `width`, `height`, `cover_url`, `media_count`, `image_count`, `video_count`, `is_carousel`, `has_video`, `has_audio`, `media_items` |
| Location | `location_id`, `location_name`, `location_lat`, `location_lng`, `location_address`, `location_city` |
| Relationships | `tagged_users`, `coauthors`, `is_pinned`, `is_branded` |
| Audio | `audio_type`, `audio_title`, `artist_name`, `audio_id`, `canonical_id`, `audio_ms`, `artwork_url`, `sound_owner`, `audio_reusable`, `audio_trending`, `mashup_count` |
| Provenance | `processor`, `processed_at` |

This abbreviated example shows the United States scenario; a real row follows the full 62-field contract and `media_items` can contain multiple carousel assets.

```json
{
  "requested_country": "United States",
  "requested_accept_language": "en-US,en;q=0.9",
  "explore_section": "Sports",
  "explore_topic": "Gymnastics",
  "post_id": "3925620145909878080_45480446092",
  "shortcode": "DZ6mrlQE01A",
  "post_url": "https://www.instagram.com/p/DZ6mrlQE01A/",
  "post_type": "carousel_video",
  "owner_username": "example_creator",
  "like_count": 1240,
  "comment_count": 31,
  "is_pinned": false,
  "media_items": [
    {
      "position": 1,
      "media_type": "video",
      "media_url": "https://api.apify.com/v2/key-value-stores/STORE_ID/records/media.mp4"
    }
  ],
  "processor": "https://apify.com/agentx/instagram-trending-scraper"
}
```

### Integration Examples

Use `agentx/instagram-trending-scraper` or the immutable Actor ID with the same United States one-result input in every integration.

#### Actor ID

```text
bUkw01H4rn1K9brjp
```

#### HTTP

```bash
curl -X POST "https://api.apify.com/v2/acts/bUkw01H4rn1K9brjp/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"max_results":1,"country":"United States"}'
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("bUkw01H4rn1K9brjp").call(
    run_input={"max_results": 1, "country": "United States"}
)
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('bUkw01H4rn1K9brjp').call({ max_results: 1, country: 'United States' });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

#### Make.com

Use the Apify “Run an Actor” module with Actor ID `bUkw01H4rn1K9brjp`, then read its default Dataset after the run succeeds.

#### n8n

Use an HTTP Request node against Actor ID `bUkw01H4rn1K9brjp`, followed by a Dataset items request using the returned `defaultDatasetId`.

#### MCP

Connect the official [Apify MCP server](https://docs.apify.com/integrations/mcp), select `agentx/instagram-trending-scraper`, and supply `{"max_results":1,"country":"United States"}`.

### Pricing

The FREE price is `$0.00390` per stored Result, plus one `$0.01` Actor Start; the smallest one-result run totals at most `$0.01390` in configured events.

| Event or tier | Price |
| --- | ---: |
| Actor Start | `$0.01000` once per run |
| FREE Result | `$0.00390` |
| BRONZE Result | `$0.00351` |
| SILVER Result | `$0.00312` |
| GOLD Result | `$0.00293` |
| PLATINUM Result | `$0.00293` |
| DIAMOND Result | `$0.00293` |

The default memory is 128 MB; the Actor Start event has a one-event minimum. A 10-result FREE-tier run has a configured event total of `$0.01 + (10 × $0.00390) = $0.04900`. Platform usage charges can also apply, and prices can change; review the [live pricing tab](https://apify.com/agentx/instagram-trending-scraper/pricing).

### Use Cases

Use the 62-field rows for workflows where Explore itself is the discovery surface.

- **Trend watchlists:** group `explore_section`, `explore_topic`, and `processed_at` across scheduled snapshots.
- **Creator discovery:** rank `owner_username` using current engagement while retaining canonical `owner_url` and post evidence.
- **Format analysis:** compare `post_type`, `is_carousel`, `has_video`, and media counts across topics.
- **Audio research:** inspect `audio_title`, `artist_name`, `audio_trending`, and `mashup_count` when Instagram supplies them.
- **Localization comparison:** compare requested locale/header pairs without treating them as a geographic origin claim.

### Alternatives

Choose this Actor when you need normalized public Explore rows with stored media and a fixed 62-field contract.

- **Manual Explore review** works for a few visual checks, but not repeatable Dataset exports.
- **Instagram's official offerings** are preferable for authorized account management and first-party insights; this Actor serves public Explore research and is not affiliated with Meta.
- **Profile, hashtag, or post tools** are a better fit when you already know the account, tag, or URL.
- **Choose something else** for private accounts, comments collection, follower exports, official national rankings, or any workflow needing login-only data.

### Limits and Troubleshooting

Expect source-dependent variation and diagnose with the smallest complete input.

- **Fewer rows than requested →** `max_results` is a cap and incomplete media candidates are skipped → retry later with `{"max_results":1,"country":"United States"}`.
- **Locale snapshots overlap →** country changes the language header, not the source IP or an official country filter → compare multiple timestamps before drawing conclusions.
- **Optional fields are empty →** Instagram did not expose that fact for the post → treat `null`, `false`, and empty collections according to their schema types.
- **A run has no rows →** Explore or required media may be temporarily unavailable → open an [Issue](https://apify.com/agentx/instagram-trending-scraper/issues) with the run ID and exact non-secret input.

### Trust and Reliability

The contract is checkable: two required inputs, 35 locale values, 62 documented fields, and Result billing only for rows actually delivered. Source omissions stay empty instead of being synthesized from the request.

### Legal and Compliance

**Public scope:** the Actor processes public Instagram Explore content and does not request credentials or private-account access.

**Your responsibility:** use the data in accordance with applicable law, privacy obligations, intellectual-property rights, and platform terms.

**No affiliation:** AgentX and this Actor are not affiliated with, endorsed by, or sponsored by Instagram or Meta.

### Frequently Asked Questions

The answers below cover the main source, billing, and localization boundaries.

#### How do I scrape Instagram Explore trending posts by locale?

Set `country` to one of the 35 locale values and run Instagram Trending Scraper; the value changes `Accept-Language`, not IP geolocation.

#### Can I schedule runs to scrape Instagram Explore trending posts?

Yes. Use an Apify schedule with the same `country` and small `max_results`, then compare `processed_at`, topics, and post IDs.

#### Is there a free Instagram trending API?

Apify accounts can use available platform credits, but this Actor is pay per event: one Actor Start plus each stored Result.

#### Does `country` prove where a post originated?

No. It selects a locale header and can influence ranking, but it is neither a post-origin field nor an official country chart.

#### Can I disable media archival?

No. The only public inputs are `max_results` and `country`; completed rows archive required media automatically.

#### Are likes, comments, and views live counters?

No. They are source snapshots captured when the post was processed and can change later.

#### How are duplicate posts handled?

The Actor deduplicates candidates within one Explore response. Separate runs remain independent snapshots.

### Related AgentX Actors

AgentX currently publishes a full catalog of Actors; start with the three closest Instagram and media workflows, then browse every other Actor by category.

Closest to this Actor:

- [Instagram Creator Scraper](https://apify.com/agentx/instagram-creator-scraper) — start from known usernames and collect creator profiles.
- [Instagram Reels Scraper](https://apify.com/agentx/instagram-reels-scraper) — start from one public account and collect its posts and Reels.
- [Instagram Reels Downloader](https://apify.com/agentx/instagram-reels-downloader) — start from a known Reel or post URL and download that media.

#### Business and Market Intelligence

- **[All Web Search Scraper](https://apify.com/agentx/all-web-search-scraper)** — multi-engine web search across ten independent indexes
- **[Google Keyword Trends](https://apify.com/agentx/google-keyword-trends)** — Google Trends keyword interest, compared five at a time
- **[Google Trends Scraper](https://apify.com/agentx/google-trends-scraper)** — Google Trends trending searches
- **[Google Maps Store Scraper](https://apify.com/agentx/google-maps-store-scraper)** — Google Maps business listings
- **[LinkedIn Company Lookup](https://apify.com/agentx/linkedin-company-lookup)** — LinkedIn company records
- **[LinkedIn Profile Lookup](https://apify.com/agentx/linkedin-profile-lookup)** — LinkedIn profile records
- **[Weather Forecast API](https://apify.com/agentx/weather-forecast-api)** — forecast and historical weather data

#### Jobs and Hiring

- **[All Jobs Scraper](https://apify.com/agentx/all-jobs-scraper)** — multi-platform job listings
- **[Bayt Jobs Scraper](https://apify.com/agentx/bayt-jobs-scraper)** — Bayt job listings
- **[Glassdoor Jobs Scraper](https://apify.com/agentx/glassdoor-jobs-scraper)** — Glassdoor job listings
- **[Indeed Jobs Scraper](https://apify.com/agentx/indeed-jobs-scraper)** — Indeed job listings
- **[JobStreet Company Profile](https://apify.com/agentx/jobstreet-company-profile)** — JobStreet employer records
- **[Jooble Jobs Scraper](https://apify.com/agentx/jooble-jobs-scraper)** — Jooble job listings
- **[LinkedIn Jobs Scraper](https://apify.com/agentx/linkedin-jobs-scraper)** — LinkedIn job listings
- **[Naukri Jobs Scraper](https://apify.com/agentx/naukri-jobs-scraper)** — Naukri job listings
- **[Talent Jobs Scraper](https://apify.com/agentx/talent-jobs-scraper)** — Talent.com job listings
- **[ZipRecruiter Jobs Scraper](https://apify.com/agentx/ziprecruiter-jobs-scraper)** — ZipRecruiter job listings

#### Social Media

- **[All Forums Thread Scraper](https://apify.com/agentx/all-forums-thread-scraper)** — multi-platform forum and Q\&A threads
- **[Instagram Creator Scraper](https://apify.com/agentx/instagram-creator-scraper)** — Instagram creator profiles
- **[Instagram Reels Scraper](https://apify.com/agentx/instagram-reels-scraper)** — Instagram Reels metadata
- **[Medium Scraper](https://apify.com/agentx/medium-scraper)** — Medium articles
- **[Medium Profile Scraper](https://apify.com/agentx/medium-profile-scraper)** — Medium author profiles
- **[Reddit Profile Scraper](https://apify.com/agentx/reddit-profile-scraper)** — Reddit user profiles
- **[Reddit Viral Scraper](https://apify.com/agentx/reddit-viral-scraper)** — Reddit viral posts
- **[SubReddit Info Scraper](https://apify.com/agentx/subreddit-info-scraper)** — subreddit metadata
- **[Subreddit Members Scraper](https://apify.com/agentx/subreddit-members-scraper)** — subreddit member lists
- **[Subreddit Posts Scraper](https://apify.com/agentx/subreddit-posts-scraper)** — subreddit post feeds
- **[Telegram Chat Scraper](https://apify.com/agentx/telegram-chat-scraper)** — Telegram chat messages
- **[Telegram Info Scraper](https://apify.com/agentx/telegram-info-scraper)** — Telegram channel metadata
- **[Telegram Member Adder](https://apify.com/agentx/telegram-member-adder)** — Telegram group membership management
- **[Telegram Member Scraper](https://apify.com/agentx/telegram-member-scraper)** — Telegram group members
- **[Telegram Private Group Scraper](https://apify.com/agentx/telegram-private-group-scraper)** — private Telegram group data
- **[TikTok Creator API](https://apify.com/agentx/tiktok-creator-api)** — TikTok creator profiles
- **[TikTok User Lookup](https://apify.com/agentx/tiktok-user-lookup)** — TikTok account records
- **[X Twitter Community API](https://apify.com/agentx/x-twitter-community-api)** — X community data
- **[X Twitter Profile Lookup](https://apify.com/agentx/x-twitter-profile-lookup)** — X profile records
- **[YouTube Creator Email Scraper](https://apify.com/agentx/youtube-creator-email-scraper)** — YouTube creator contact data

#### Video, Transcripts and Downloads

- **[All Video Scraper](https://apify.com/agentx/all-video-scraper)** — multi-platform video metadata
- **[All Short Videos Scraper](https://apify.com/agentx/all-short-videos-scraper)** — short-video keyword search across two independent indexes
- **[All Image Scraper](https://apify.com/agentx/all-image-scraper)** — image search and download across five engines
- **[All Short Drama Downloader](https://apify.com/agentx/all-short-drama-downloader)** — short-drama episodes from fifteen official apps
- **[Video Transcript](https://apify.com/agentx/video-transcript)** — multi-platform transcripts
- **[Video Captions Downloader](https://apify.com/agentx/video-captions-downloader)** — caption files
- **[Video to Social Post](https://apify.com/agentx/video-to-social-post)** — video repurposed into social copy
- **[YouTube Transcript](https://apify.com/agentx/youtube-transcript)** — YouTube transcripts
- **[TikTok Transcript](https://apify.com/agentx/tiktok-transcript)** — TikTok transcripts
- **[X Twitter Transcript](https://apify.com/agentx/x-twitter-transcript)** — X video transcripts
- **[Facebook Transcript](https://apify.com/agentx/facebook-transcript)** — Facebook video transcripts
- **[Bilibili Transcript](https://apify.com/agentx/bilibili-transcript)** — Bilibili transcripts
- **[Dailymotion Transcript](https://apify.com/agentx/dailymotion-transcript)** — Dailymotion transcripts
- **[Rutube Transcript](https://apify.com/agentx/rutube-transcript)** — Rutube transcripts
- **[Loom Transcript](https://apify.com/agentx/loom-transcript)** — Loom transcripts
- **[Wistia Transcript](https://apify.com/agentx/wistia-transcript)** — Wistia transcripts
- **[Instagram Reels Downloader](https://apify.com/agentx/instagram-reels-downloader)** — Reels downloads
- **[Kick Clip Downloader](https://apify.com/agentx/kick-clip-downloader)** — Kick clip downloads
- **[Linkedin Video Downloader](https://apify.com/agentx/linkedin-video-downloader)** — LinkedIn video downloads
- **[Pinterest Video Downloader](https://apify.com/agentx/pinterest-video-downloader)** — Pinterest video downloads
- **[Reddit Video Downloader](https://apify.com/agentx/reddit-video-downloader)** — Reddit video downloads
- **[Snapchat Video Downloader](https://apify.com/agentx/snapchat-video-downloader)** — Snapchat video downloads
- **[TED Talk Downloader](https://apify.com/agentx/ted-talk-downloader)** — TED talk downloads
- **[TikTok Live Downloader](https://apify.com/agentx/tiktok-live-downloader)** — TikTok live downloads
- **[Twitch VOD Downloader](https://apify.com/agentx/twitch-vod-downloader)** — Twitch VOD downloads
- **[Zoom Recording Downloader](https://apify.com/agentx/zoom-recording-downloader)** — Zoom recording downloads

#### E-Commerce and Retail

- **[All Shopping Scraper](https://apify.com/agentx/all-shopping-scraper)** — multi-platform product data
- **[AliExpress Product Scraper](https://apify.com/agentx/aliexpress-product-scraper)** — AliExpress products
- **[Amazon Storefront Scraper](https://apify.com/agentx/amazon-storefront-scraper)** — Amazon Brand Store pages
- **[Bol Product Scraper](https://apify.com/agentx/bol-product-scraper)** — Bol.com products
- **[eBay Seller Leads API](https://apify.com/agentx/ebay-seller-leads-api)** — eBay seller records
- **[Hepsiburada Product Scraper](https://apify.com/agentx/hepsiburada-product-scraper)** — Hepsiburada products
- **[Kakaku Product Scraper](https://apify.com/agentx/kakaku-product-scraper)** — Kakaku.com products
- **[Rakuten Product Scraper](https://apify.com/agentx/rakuten-product-scraper)** — Rakuten products

#### Classifieds and Automotive

- **[All Vehicle Scraper](https://apify.com/agentx/all-vehicle-scraper)** — multi-platform vehicle listings
- **[AutoTrader Vehicle Search](https://apify.com/agentx/autotrader-vehicle-search)** — AutoTrader US listings
- **[AutoTrader UK Vehicle Search](https://apify.com/agentx/autotrader-uk-vehicle-search)** — AutoTrader UK listings

#### Real Estate

- **[All Property Scraper](https://apify.com/agentx/all-property-scraper)** — multi-platform property listings
- **[Homes Property Scraper](https://apify.com/agentx/homes-property-scraper)** — Homes.com listings
- **[MagicBricks Property Scraper](https://apify.com/agentx/magicbricks-property-scraper)** — MagicBricks listings
- **[NoBroker Property Scraper](https://apify.com/agentx/nobroker-property-scraper)** — NoBroker listings
- **[Property24 Property Scraper](https://apify.com/agentx/property24-property-scraper)** — Property24 listings
- **[Realtor Property Scraper](https://apify.com/agentx/realtor-property-scraper)** — Realtor.com listings
- **[Zillow Property Scraper](https://apify.com/agentx/zillow-property-scraper)** — Zillow listings

### Support and Community

Ask about Instagram Explore fields, content locales, or scheduled trend snapshots in the [AgentX community on Telegram](https://t.me/Apify_Actor); for a reproducible bug, open an Issue with the run ID and the exact non-secret input.

AgentX is an Arcyton brand — [arcyton.com](https://arcyton.com).

**Last Updated:** August 12, 2026

# Actor input Schema

## `max_results` (type: `integer`):

Maximum successfully published Explore rows. Source availability or media failures can return fewer rows.

## `country` (type: `string`):

Selects the country-style content locale sent in Instagram's Accept-Language header. It may influence Explore ranking but does not guarantee IP geolocation or country-only posts.

## Actor input object example

```json
{
  "max_results": 1,
  "country": "United States"
}
```

# Actor output Schema

## `results` (type: `string`):

Browse all 62 fields in the default Dataset overview, including Explore labels, request provenance, music metadata, and Actor storage URLs.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "max_results": 1,
    "country": "United States"
};

// Run the Actor and wait for it to finish
const run = await client.actor("agentx/instagram-trending-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "max_results": 1,
    "country": "United States",
}

# Run the Actor and wait for it to finish
run = client.actor("agentx/instagram-trending-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "max_results": 1,
  "country": "United States"
}' |
apify call agentx/instagram-trending-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,agentx/instagram-trending-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/bUkw01H4rn1K9brjp/builds/lYf84izO9sX7wYi4j/openapi.json
