Retrieving Filtered Mentions

Listing a filtered set of Mentions within your Query.

All Mention data calls can be filtered so that you can access specific parts of your data. You can do this by using Filters. To learn more about the available filters, please see Filters.

On this page we will show you:

Example Call - Filtering by Sentiment and Page Type

We want to restrict the data that is returned to be only tweets with neutral sentiment. We use two Filters for this:

  • pageType - In our particular case, we are interested in twitter.
  • sentiment - We want neutral Mentions to be returned.

The Filters are passed as parameters to the Mentions data call:
(For more information on making a basic Mentions call, see Retrieving Mentions)

curl -X GET 'https://api.brandwatch.com/projects/289733322/data/mentions?queryId=1998640329&startDate=2016-05-01&endDate=2016-05-02&page=0&pageSize=1&pageType=twitter&sentiment=neutral'

Here is one Mention that matches those Filters, out of a total of 57:

{
    "results": [
      {
            "resourceId": "05b7ea94bde2f66ae07b46ee8d076fa7",
            "accountType": "individual",
            "added": "2019-09-07T07:43:29.807+0000",
            "assignment": null,
            "author": null,
            "avatarUrl": null,
            "categories": [
                6745905
            ],
            "categoryDetails": [
                {
                    "id": "6745905",
                    "name": "Vodafone",
                    "parentId": "6745904",
                    "parentName": "Internet-Anbieter"
                }
            ],
            "checked": false,
            "city": "Stuttgart",
            "cityCode": "DEU.Baden-Wurttemberg.Stuttgart",
            "continent": "Europe",
            "continentCode": "EUROPE",
            "country": "Germany",
            "countryCode": "DEU",
            "region": "Baden-Württemberg",
            "regionCode": "DEU.Baden-Wurttemberg",
            "date": null,
            "displayUrls": null,
            "domain": "twitter.com",
            "engagement": 0.0,
            "expandedUrls": null,
            "facebookAuthorId": null,
            "facebookComments": 0,
            "facebookLikes": 0,
            "facebookRole": null,
            "facebookShares": 0,
            "facebookSubtype": null,
            "fullname": "YFYvonneAu1 (Yvonne Y. F. Kelle)",
            "gender": "female",
            "impressions": 0,
            "insightsHashtag": null,
            "insightsMentioned": null,
            "instagramCommentCount": 0,
            "instagramFollowerCount": 0,
            "instagramFollowingCount": 0,
            "instagramInteractionsCount": 0,
            "instagramLikeCount": 0,
            "instagramPostCount": 0,
            "interest": [],
            "language": "en",
            "lastAssignmentDate": null,
            "latitude": 0.0,
            "locationName": "Stuttgart, Baden-Wurttemberg, DEU",
            "longitude": 0.0,
            "matchPositions": [
                {
                    "start": 42,
                    "text": "Vodafone",
                    "length": 8
                },
                {
                    "start": 51,
                    "text": "internet",
                    "length": 8
                }
            ],
            "mediaFilter": null,
            "mediaUrls": [],
            "monthlyVisitors": 1308696000,
            "originalUrl": null,
            "pageType": "twitter",
            "priority": null,
            "professions": [],
            "queryId": 1999832640,
            "queryName": "Internet Anbieter",
            "reachEstimate": 0,
            "replyTo": null,
            "resourceType": "crimsonMonitor",
            "retweetOf": null,
            "sentiment": "neutral",
            "shortUrls": null,
            "snippet": null,
            "starred": false,
            "status": null,
            "subtype": null,
            "tags": [],
            "threadAuthor": null,
            "threadCreated": "2019-09-04T19:29:16.000+0000",
            "threadEntryType": null,
            "threadId": "1169331615333593089",
            "threadURL": null,
            "title": "http://twitter.com/1/statuses/1169390903821262848",
            "trackedLinkClicks": 0,
            "trackedLinks": null,
            "twitterAuthorId": null,
            "twitterFollowers": null,
            "twitterFollowing": null,
            "twitterPostCount": null,
            "twitterReplyCount": null,
            "twitterRetweets": null,
            "twitterRole": null,
            "twitterVerified": null,
            "updated": "2019-09-07T07:43:29.807+0000",
            "url": "http://twitter.com/1/statuses/1169390903821262848",
            "classifications": [
                {
                    "classifierId": "emotions",
                    "labelId": "Sadness",
                    "name": "Sadness",
                    "confidence": 0.021398207
                },
                {
                    "classifierId": "emotions",
                    "labelId": "Fear",
                    "name": "Fear",
                    "confidence": 0.067933984
                }
            ],
            "pageTypeName": "Twitter",
            "impact": 0.0
        }
    ],
    "resultsPage": 0,
    "resultsPageSize": 1,
    "resultsTotal": 225,
    "nextCursor": "AQ=AA=AWz-mFWg=MTk5OTgzMjY0MCEwNWI3ZWE5NGJkZTJmNjZhZTA3YjQ2ZWU4ZDA3NmZhNw",
    "startDate": "2019-09-01T00:00:00.000+0000",
    "endDate": "2019-09-05T00:00:00.000+0000"
}

Example Call - Filtering by Tags and Categories

You can also Filter your Mentions by the Categories and Tags that are assigned to them. For your Project, you will need to first retrieve the Categories or Tags that you wish to filter by. You will use the associated Category or Tag IDs in the following parameters:

  • tag - Return Mentions that are tagged with this Tag ID.
  • xtag - Return Mentions that are not tagged with this Tag ID.
  • category - Return Mentions that are tagged with this Category ID.
  • xcategory - Return Mentions that are not tagged with this Category ID.

For more information on how to find the appropriate ID, see Retrieving Categories and Retrieving Tags.

The Filters are passed as parameters to the Mentions data call. For example, to return Mentions that are tagged by Category ID 838322:
(For more information on making a basic Mentions call, see Retrieving Mentions)

curl -X GET 'https://api.brandwatch.com/projects/289733322/data/mentions?queryId=1998640329&startDate=2016-05-01&endDate=2016-05-02&page=0&pageSize=1&category=838322'

Here is one Mention that matches those Filters, out of total of 72:

{
  "resultsTotal": 72,
  "resultsPage": 0,
  "resultsPageSize": 1,
  "results": [
    {
      "accountType": null,
      "assignment": null,
      "author": "Najah Sameen",
      "avatarUrl": null,
      "categories": [838322],
      "categoryDetails": [
        {
          "id": "838322",
          "name": "Lips",
          "parentId": "838321",
          "parentName": "Beauty products"
        }
      ],
      "checked": false,
      "continent": "North America",
      "continentCode": "n-a",
      "country": "United States",
      "countryCode": "us",
      "region": null,
      "regionCode": null,
      "date": "2016-05-01T11:52:05.699+0000",
      "displayUrls": [],
      "domain": "www.indianbeautyforever.com",
      "facebookAuthorId": null,
      "facebookComments": 0,
      "facebookLikes": 0,
      "facebookRole": null,
      "facebookShares": 0,
      "facebookSubtype": null,
      "fullname": null,
      "gender": "unknown",
      "id": 99581066231,
      "impact": 39,
      "impressions": 0,
      "influence": 0,
      "insightsHashtag": [],
      "insightsMentioned": [],
      "instagramCommentCount": 0,
      "instagramFollowerCount": 0,
      "instagramFollowingCount": 0,
      "instagramLikeCount": 0,
      "instagramPostCount": 0,
      "interest": [],
      "language": "en",
      "lastAssignmentDate": null,
      "latitude": 0,
      "locationName": null,
      "longitude": 0,
      "matchPositions": [
        {
          "start": 133,
          "text": "oil",
          "length": 3
        },
        {
          "start": 150,
          "text": "oil",
          "length": 3
        },
        {
          "start": 178,
          "text": "moisturizing",
          "length": 12
        },
        {
          "start": 201,
          "text": "lips",
          "length": 4
        },
        {
          "start": 217,
          "text": "use",
          "length": 3
        },
        {
          "start": 227,
          "text": "at",
          "length": 2
        },
        {
          "start": 230,
          "text": "night",
          "length": 5
        },
        {
          "start": 247,
          "text": "lips",
          "length": 4
        }
      ],
      "mediaUrls": [],
      "monthlyVisitors": 0,
      "noteIds": [],
      "pageType": "news",
      "priority": null,
      "professions": [],
      "queryId": 1998640329,
      "queryName": "Makeup",
      "reach": 0,
      "replyTo": null,
      "resourceId": 99581066231,
      "resourceType": "page",
      "retweetOf": null,
      "sentiment": "positive",
      "shortUrls": [],
      "snippet": "Mango butter. These will hydrate and soften the dry lips. These lip balms also contain essential oils like macadamia nut oil, castor oil, carrot seed oil etc which are immensely moisturizing for flaky lips. I like to use these at night to give my lips boost of moisture. These lip moisturizer are mildly sweet in taste hence if you lick it you...",
      "starred": false,
      "state": null,
      "stateCode": null,
      "status": null,
      "subtype": null,
      "tags": [],
      "threadAuthor": null,
      "threadCreated": null,
      "threadEntryType": null,
      "threadId": "0",
      "threadURL": null,
      "title": "Island Kiss Tropical Lip Moisturisers Review - Indian Beauty Forever",
      "twitterAuthorId": null,
      "twitterFollowers": 0,
      "twitterFollowing": 0,
      "twitterPostCount": 0,
      "twitterReplyCount": 0,
      "twitterRetweets": 0,
      "twitterRole": null,
      "twitterVerified": false,
      "url": "http://www.indianbeautyforever.com/2016/04/island-kiss-tropical-lip-moisturisers-review.html?showComment=1462103525699",
    }
  ],
  "maximumId": 99581066231,
  "maximumIdInResult": 99581066231,
  "startDate": "2016-05-01T00:00:00.000+0000",
  "endDate": "2016-05-02T00:00:00.000+0000"
}