NAVNavbar
Logo
php python csharp java

Competitor Data API


Competitor API will provide you with website traffic and competitor data. You will receive total website visits, website traffic by countries along with its sources, site ranks, and various competitor data. This data is especially useful for running competitor analysis and market intelligence campaigns. Note that you can get data only for websites with over 5,000 monthly visitors.

It takes up to 30 seconds to retrieve the results of the task.

Competitor Info

Instead of ‘login’ and ‘password’ use your credentials from https://my.dataforseo.com/#api_dashboard

<?php
require('RestClient.php');
//You can download this file from here https://api.dataforseo.com/_examples/php/_php_RestClient.zip

try {

    //Instead of 'login' and 'password' use your credentials from https://my.dataforseo.com/#api_dashboard
    $client = new RestClient('https://api.dataforseo.com/', null, 'login', 'password');

    $cmp_get_result = $client->get('v2/cmp_get/asana.com');
    print_r($cmp_get_result);

    //do something with results

} catch (RestClientException $e) {
    echo "\n";
    print "HTTP code: {$e->getHttpCode()}\n";
    print "Error code: {$e->getCode()}\n";
    print "Message: {$e->getMessage()}\n";
    print  $e->getTraceAsString();
    echo "\n";
    exit();
}

$client = null;
?>

The above command returns JSON structured like this:

{
    "status": "ok",
    "results_time": "0.2813 sec.",
    "results_count": 1,
    "results": [
        {
            "task_id": 5173707117,
            "date": "2019-06-01",
            "site_url": "asana.com",
            "site_description": "easily organize and plan workflows, projects, and more, so you can keep your team's work on schedule. start using asana as your work management tool today.",
            "global_rank": {
                "rank": 1226
            },
            "country_rank": {
                "rank": 766,
                "country": "United States"
            },
            "category_rank": {
                "rank": 62,
                "category": "Computers_Electronics_and_Technology\/Computers_Electronics_and_Technology"
            },
            "audience": {
                "visits": 31088108,
                "time_on_site_avg": "00:10:08",
                "page_views_avg": 7.8695507409915,
                "bounce_rate": 32.48
            },
            "traffic": {
                "value": 31088108,
                "percent": 100,
                "countries": [
                    {
                        "country": "United States",
                        "value": 9700035,
                        "percent": 31.2
                    },
                    {
                        "country": "United Kingdom",
                        "value": 1504847,
                        "percent": 4.84
                    },
                    {
                        "country": "Brazil",
                        "value": 1337629,
                        "percent": 4.3
                    },
                    {
                        "country": "Mexico",
                        "value": 1027171,
                        "percent": 3.3
                    },
                    {
                        "country": "Poland",
                        "value": 943149,
                        "percent": 3.03
                    },
                    {
                        "country": "Other",
                        "value": 16579287,
                        "percent": 53.33
                    }
                ],
                "sources": {
                    "direct": {
                        "value": 26543904,
                        "percent": 85.38
                    },
                    "search_organic": {
                        "value": 2532234,
                        "percent": 8.15,
                        "top_keywords": [
                            {
                                "keyword": "asana",
                                "value": 2028319,
                                "percent": 80.1
                            },
                            {
                                "keyword": "asana login",
                                "value": 30133,
                                "percent": 1.19
                            },
                            {
                                "keyword": "асана",
                                "value": 20004,
                                "percent": 0.79
                            },
                            {
                                "keyword": "asana careers",
                                "value": 11901,
                                "percent": 0.47
                            },
                            {
                                "keyword": "asana pricing",
                                "value": 10128,
                                "percent": 0.4
                            }
                        ]
                    },
                    "search_ad": {
                        "value": 236142,
                        "percent": 0.76,
                        "top_keywords": [
                            {
                                "keyword": "asana",
                                "value": 17025,
                                "percent": 7.21
                            },
                            {
                                "keyword": "trello",
                                "value": 141,
                                "percent": 0.06
                            },
                            {
                                "keyword": "free personal kanban software",
                                "value": 141,
                                "percent": 0.06
                            },
                            {
                                "keyword": "meeting agenda examples",
                                "value": 118,
                                "percent": 0.05
                            },
                            {
                                "keyword": "asana pricing",
                                "value": 118,
                                "percent": 0.05
                            }
                        ]
                    },
                    "referral": {
                        "value": 181166,
                        "percent": 0.58,
                        "top_referrals": [
                        {
                            "site": "blog.capterra.com",
                            "value": 204328,
                            "percent": 4.56
                        },
                        {
                            "site": "instagantt.com",
                            "value": 189092,
                            "percent": 4.22
                        },
                        {
                            "site": "news.ycombinator.com",
                            "value": 177579,
                            "percent": 3.96
                        }
                        ]
                    },
                    "referral_ad": {
                        "value": 11266,
                        "percent": 0.04,
                        "top_referrals": [
                            {
                                "site": "forbes.com"
                            },
                            {
                                "site": "dividendobr.com"
                            },
                            {
                                "site": "worksheets.theteacherscorner.net"
                            },
                            {
                                "site": "audiworld.com"
                            },
                            {
                                "site": "outlook.live.com"
                            }
                        ]
                    },
                    "social": {
                        "value": 419085,
                        "percent": 1.35,
                        "top_socials": [
                            {
                                "site": "Facebook",
                                "value": 166041,
                                "percent": 39.62
                            },
                            {
                                "site": "Youtube",
                                "value": 114242,
                                "percent": 27.26
                            },
                            {
                                "site": "WhatsApp Webapp",
                                "value": 51463,
                                "percent": 12.28
                            },
                            {
                                "site": "Linkedin",
                                "value": 15506,
                                "percent": 3.7
                            },
                            {
                                "site": "Twitter",
                                "value": 14961,
                                "percent": 3.57
                            }
                        ]
                    },
                    "mobile_apps": {
                        "google_play_store": [
                            {
                                "app_id": "com.asana.app",
                                "app_title": "Asana: organize team projects",
                                "app_price": "Free",
                                "app_rating": "88.1559272766113%",
                                "app_link": "play.google.com\/store\/apps\/details?id=com.asana.app"
                            }
                        ],
                        "app_store": [
                            {
                                "app_id": "489969512",
                                "app_title": "Asana: organize tasks & work",
                                "app_price": "0.0 USD",
                                "app_rating": "90.9%",
                                "app_link": "itunes.apple.com\/us\/app\/id489969512"
                            }
                        ]
                    },
                    "mail": {
                        "value": 1164308,
                        "percent": 3.75
                    }
                },
                "estimated": {
                    "2019-01-01": 35439181,
                    "2019-02-01": 32218310,
                    "2019-03-01": 33855022,
                    "2019-04-01": 33265190,
                    "2019-05-01": 32071815,
                    "2019-06-01": 31088108
                }
            },
            "sites": {
                "similar_sites": [
                    {
                        "site": "trello.com",
                        "rank": 259
                    },
                    {
                        "site": "calendar.google.com",
                        "rank": 0
                    },
                    {
                        "site": "monday.com",
                        "rank": 5679
                    },
                    {
                        "site": "asana-user-private-us-east-1.s3.amazonaws.com",
                        "rank": 58391
                    },
                    {
                        "site": "upwork.com",
                        "rank": 882
                    },
                    {
                        "site": "airtable.com",
                        "rank": 4957
                    },
                    {
                        "site": "slack.com",
                        "rank": 271
                    },
                    {
                        "site": "zoom.us",
                        "rank": 584
                    },
                    {
                        "site": "projects.invisionapp.com",
                        "rank": 0
                    },
                    {
                        "site": "codepen.io",
                        "rank": 2042
                    }
                ],
                "similar_sites_by_rank": [
                    {
                        "site": "github.com"
                    },
                    {
                        "site": "wordpress.com"
                    },
                    {
                        "site": "adobe.com"
                    },
                    {
                        "site": "trello.com"
                    },
                    {
                        "site": "slack.com"
                    },
                    {
                        "site": "goo.gl"
                    },
                    {
                        "site": "icloud.com"
                    },
                    {
                        "site": "zoom.us"
                    },
                    {
                        "site": "upwork.com"
                    },
                    {
                        "site": "bitly.com"
                    }
                ]
            }
        }
    ]
}

This feature will provide you with information about traffic and its sources, as well as visits analysis of your competitors websites.

The information is received via GET method with the following parameters:

Field name Type Description
domain string domain
required field


As a response of API server you will receive a JSON array in the results field of which there will be data for the competitor domain.

Field name Type Description
status string general result
“ok” – successful
“error” – error
if status=“error”, check the error array for more details
error array informational array of the error
only if status=“error”
the list of possible errors can be found below.
      code integer error code
      message string text description of the error
results_time string execution time, seconds
results_count string number of elements in the results array
results array array of results
      task_id integer unique task identifier in our system (UInt64)
      date string month when the information was received
in the format “year-month-date”
all information provided for this month
      site_url string domain URL
      site_description string main page ‘Description’ metatag
      global_rank array global rank information
         rank integer global traffic rank of site
      country_rank array country rank information
         rank integer traffic rank of site in its leading country
         country string leading country name
      category_rank array category rank information
         rank integer traffic rank of site in its main category
         category string main category name
      audience array audience information
         visits integer total visits
         time_on_site_avg string average visit duration
         page_views_avg float average page views by visit
         bounce_rate float bounce rate
      traffic array traffic information
         value integer total traffic value
         percent float total traffic percentage
         countries array traffic by countries
            country string country
            value integer traffic value
            percent float traffic percentage
         sources array traffic sources
            direct array direct source
               value integer traffic value
               percent float traffic percentage
            search_organic array organic search
               value integer traffic value
               percent float traffic percentage
               top_keywords array top 5 organic search keywords
                  keyword string search keyword
                  value integer organic search value
                  percent float organic search percentage
            search_ad array paid search
               value integer traffic value
               percent float traffic percentage
               top_keywords array top 5 keywords
                  keyword string keyword
                  value integer paid search value
                  percent float paid search percentage
            referral array top referring sites
               value integer traffic value
               percent float traffic percentage
               top_referrals array top 5 referring sites
                  site string site
                  value integer referral traffic value
                  percent float referral traffic percentage
            referral_ad array advertising publishers
               value integer traffic value
               percent float traffic percentage
               top_referrals array top 5 publishers
                  site string site
            social array traffic from social media
               value integer traffic value
               percent float traffic percentage
               top_socials array top socials
                  site string social
                  value integer social traffic value
                  percent float social traffic percentage
            mobile_apps array top mobile apps
               google_play_store array mobile apps in Google Play store
                  app_id string application ID
                  app_title string application title
                  app_price string application price
                  app_rating string application rating in percent
                  app_rating_count string application rating count
                  app_link string link to mobile app in store
               app_store array mobile apps in Apple Store
                  app_id string application ID
                  app_title string application title
                  app_price string application price
                  app_rating string application rating in percent
                  app_link string link to mobile app in store
            mail array source
               value integer traffic value
               percent float traffic percentage
         estimated array estimated traffic by months
            $month integer this month estimated traffic value
      sites array list of websites that have similar content or rank
         similar_sites array domains of websites with content similar to the specified site
they may share the same audience, compete on the same keywords, сommon links to and from the compared sites, share similar content
            site string site
            rank integer domain rank
the less the number is, the higher rank the website has
         similar_sites_by_rank array domains of websites that are ranked based on SimilarWeb algorithm
            site string site


Possible error codes:

Error Code Meaning
500 “Rate limit. Set the next task in 60 seconds” – occurs when our service exceeds the limit of competitors tasks per minute. We recommend to process these errors (just like any other errors) and set the next task in 60 seconds if this error occurs.