Trends API
Jump to Evaluate your performance against top 5 competitorsEvaluate your performance against top 5 competitors
Understanding how your online performance stacks up against your top competitors is what drives smarter actions, sharper strategies, and better results.
This tutorial shows you how to use Trends API to analyze your top 5 competitors’ online performance: their traffic, behavior, traffic sources, geography, and audience, and compare these metrics to yours. Follow the step-by-step guide to get actionable insights and use your Trends API units efficiently.
Before analyzing performance, it’s important to know who your competitors are. If needed, you can discover your online competitors using Semrush tools. In this tutorial, we’ll use the top 5 domains from the e-commerce industry in the United States as an example to guide you through each step.
Jump to Before you startBefore you start
- Make sure you have:
- Access to Trends API.
- Enough Trends API units to make calls. Following the examples from this tutorial, you’ll spend a total of 30 API units.
- Get your API key from the Subscription Info tab.
You can use API testing tools like Postman to test your requests before full implementation. Note that test requests consume API units.
Jump to Step 1. Compare traffic performance across competitorsStep 1. Compare traffic performance across competitors
Jump to Step 1.1. Get traffic overviewStep 1.1. Get traffic overview
The first step is to compare your top 5 competitors’ performance to yours at a high level. This helps you quickly identify who leads in traffic volume, user engagement, and overall visibility, so you can prioritize which domains to analyze in more detail.
Relevant API method: Traffic Summary
Request cost: 1 API unit per line. When accessing data for 5 competitors’ domains and your own, you’ll receive 6 lines, which will cost 6 API units.
https://api.semrush.com/analytics/ta/api/v3/summary?targets=YOUR_DOMAIN,ebay.com,walmart.com,etsy.com,homedepot.com,target.com&export_columns=target,visits,users,time_on_site,pages_per_visit,bounce_rate&key=YOUR_API_KEYHow to use:
- Specify your domain (replace
YOUR_DOMAINwith your website) and the competitor domains. For example,targets=YOUR_DOMAIN,ebay.com,walmart.com,etsy.com,homedepot.com,target.com. - Specify
YOUR_API_KEY. - (Optional) Include additional parameters to receive results that are more tailored to your specific use case:
- If you want to retrieve data for a specific timeline, set the
display_dateparameter value following theYYYY-MM-01format. If thedisplay_dateparameter isn’t specified, data from the previous month is shown by default. - If you want to retrieve data for a specific country, set the country parameter value. For example, set
country=usfor the United States. - If necessary, you can use the
export_columnsparameter to select the columns you want to extract into this report and limit the results. For example, to get competitor website visits, unique visitors (users), average visit duration, bounce rate, and pages per visit, set the following values:export_columns=target,visits,users,time_on_site,pages_per_visit,bounce_rate.
- If you want to retrieve data for a specific timeline, set the
- Send the request.
Result: You’ll get a report with your and competitors’ data for traffic rank, visits, unique visitors, pages per visit, average visit duration, and bounce rate.
Jump to Step 1.2. (Optional) Get daily traffic insightsStep 1.2. (Optional) Get daily traffic insights
If you want to go beyond the monthly snapshot and uncover daily patterns, seasonality, or campaign impact, you can use the Daily Traffic method for each domain.
Request cost: 1 API unit per request. To access 5 competitors’ domains and your own, you need to make 6 requests, which will cost 6 API units.
https://api.semrush.com/analytics/ta/api/v3/summary_by_day?target=ebay.com&key=YOUR_API_KEYHow to use:
- Specify the competitor’s domain using the target parameter. For example,
target=ebay.com. - Specify
YOUR_API_KEY. - Send the request.
- Repeat for each competitor’s domain and your own.
Result: You’ll get a day-by-day breakdown of traffic—ideal for spotting spikes, dips, and short-term volatility.
Jump to Step 2. Analyze competitor traffic sources, regions, and audiencesStep 2. Analyze competitor traffic sources, regions, and audiences
After reviewing traffic metrics across all competitors, the next step is to understand traffic sources, assess geographic focus, and profile audience demographics.
The instructions for how to use the API methods and the request cost apply to all the Step 2 methods.
How to use:
- Specify the competitor’s domain using the target parameter. For example,
target=ebay.com. - Specify
YOUR_API_KEY. - Send the request.
- Repeat for each competitor’s domain and your own.
Request cost: 1 API unit per request. To access 5 competitors’ domains and your own, you need to make 6 requests, which will cost 6 API units. For the following 3 methods, you’ll spend a total of 18 API units.
Jump to Step 2.1. Understand traffic channelsStep 2.1. Understand traffic channels
Goal: Understand where competitors get their traffic from (for example, direct, referral, search, or social) to uncover their primary growth strategies.
Relevant API method: Traffic Sources
https://api.semrush.com/analytics/ta/api/v3/traffic_sources?target=ebay.com&key=YOUR_API_KEYResult: You’ll get a channel-by-channel traffic breakdown, allowing you to spot organic and paid leaders and benchmark acquisition strategies.
Jump to Step 2.2. Spot regional playersStep 2.2. Spot regional players
Goal: Discover where competitor audiences are located to gain insights into the geographic diversity and distribution of your market audience.
Relevant API method: Geo Distribution
https://api.semrush.com/analytics/ta/api/v3/geo_distribution?target=ebay.com&key=YOUR_API_KEYResult: You’ll get a list of countries where traffic to your selected domains comes from.
Jump to Step 2.3. Analyze your market demographicsStep 2.3. Analyze your market demographics
Goal: Analyze competitor visitor demographics to enhance your segmentation and targeting.
Relevant API method: Age and Sex Distribution
https://api.semrush.com/analytics/ta/api/v3/age_sex_distribution?target=ebay.com&key=YOUR_API_KEYResult: You’ll get a demographic breakdown by age and gender, making it easier to identify competitors with overlapping audiences and fine-tune your messaging or ad targeting.
Jump to Step 3. Turn data into strategyStep 3. Turn data into strategy
The data from this tutorial shows where your competitors outperform and where they fall short. Now’s your chance to:
- Match your metrics side-by-side with theirs
- Identify channels where you’re over- or under-investing
- See how your audience composition compares
Turn these findings into action by improving content strategy, ad targeting, and regional focus, based on exactly how your competitors are succeeding.
Jump to What’s nextWhat’s next
- Discover more relevant endpoints for deeper research in the Trends API reference.
- Browse Traffic & Market use cases and success stories to see how businesses leverage this data for strategic wins—perfect for shaping your own business case.
Last updated: January 29, 2026