Data Explorer

REMINDER: This endpoint is being deprecated by May 1, 2024! Please only use this for temporary reference and use the GraphQL V2 for new/updating queries!

What Does a Query Look Like?

A GraphQL query has two parts: the call, and the query variables.

The call (displayed on the first tab below) first gets a defined name, and the arguments (variables) being passed in to the types within the query.

Then in here, using the schema, you define the fields you want as a part of that call.

Each field has its own special schema that provides a list of subfields and variables needed to specify what should be returned.

query ResultsBy($filter: Filter!, $options: Option, $dimension: Group!) {
  #Field(arguments needed/wanted to use this field)
  resultsBy(dimension: $dimension, options: $options, filter: $filter) {
    #selection set(s) (AKA set of fields or subfields which can be nested) 
    #example, the set groups contains the field value and the set results
    groups {
      value
      results {
        content
      }
    }
  }
  #AnotherField(arguments needed/wanted to use this field)
  userNames(options: $options, filter: $filter)
}

The query variables are used to fill in the parameters as seen above.

These are also defined using the schema, but the formatting style for this data is called JSON.

{
  "filter": {
    "searches": [
      "{{ search_hash }}"
    ],
    "dateFrom": "2018-07-16T09:56:37Z",
    "dateTo": "2020-07-16T09:56:37Z"
  },
  "dimension": "DATE",
  "options": {
      "limit": 3,
      "facet": {
          "limit": 1
      }
  }
}

What Does A Payload Look Like?

A returned payload can vary based on the call sent, but you will be sent back some form of a JSON with your data organized precisely how you have asked for it back.

For example, in a Brand query on CORE like this:

query Brands($page: Int, $limit: Int) {
  brands(page: $page, limit: $limit){
    total
    nextPage
    brands {
      brandType
      brandsetName
      profiles{
        id
        name
      }
      id
    }
    }
}

You will see a return that looks like this:

{
  "data": {
    "brands": {
      "total": 106,
      "nextPage": 2,
      "brands": [
        {
          "brandType": "competitor",
          "brandsetName": "Extendi",
          "profiles": [
            {
              "id": 1,
              "name": "UNILAD"
            },
            {
              "id": 4,
              "name": "DEV Community 👩💻👨💻"
            }
          ],
          "id": 1
        },
        {
          "brandType": "owned",
          "brandsetName": "Extendi",
          "profiles": [
            {
              "id": 381,
              "name": "Schiaccia Il 5"
            },
            {
              "id": 382,
              "name": "edoardomarsili"
            },
            {
              "id": 383,
              "name": "Schiaccia Il 5"
            },
            {
              "id": 523,
              "name": "Edoardo Marsili"
            }
          ],
          "id": 186
        }
      ]
    }
  },
  "variables": null
}

Note that the formatting is the same as the variables for a query: JSON.

What’s particularly nice about this is you know exactly where to find each bit of a query you have requested, as it is always in the same order that you requested it.

At the end of your payload will be the variables you used to define the query, so you always have that information handy in the return if you need to sense check your data.

Sample Calls - Intro

Below are a handful of sample calls to help you understand how the data explorer works on both TRAC and CORE.

Each sample call will contain the query and variables in one tab, followed by the Response in the other.

We do this to keep formatting consistent with how most API testing environments would surface the blocks as groups.

TRAC - Data Explorer

For all queries, POST to this GraphQL endpoint URL:

https://data-explorer.pulsarplatform.com/graphql/trac

Creating a Search from Scratch

This is currently not supported by the GraphQL API, but can be accomplished via the REST API. Learn more here.

Getting a List of your First 5 Searches

Use the page option to traverse through if you have more than 10 searches

query Searches($limit: Int, $page: Int){
  searches(limit: $limit, page: $page){
    total
    searches{
      search
      status
      searchName
      realtimeStatus
    }
  }
}
{
	"limit" : 5
}

Fetching Search Content

Replace hashX with your search hash.

query ComplexResults($stat: Stat, $dimension: Dimension, $options: Option, $filter: Filter!) {
  results(stat: $stat, dimension: $dimension, options: $options, filter: $filter) {
    total
 nextCursor
    results {
     createdAt
      content
      engagement
      sentiment
       url
       keywords
    }
  }
}
{
	"filter": {
		"searches": [
			"hash1"
		],
		"bioKeywords": [
			"nft"
		],
		"dateFrom": "2023-01-01T00:00:00Z",
		"dateTo": "2023-01-26T23:59:59Z"
	},
	"options": {
		"limit": 100
	}
}

Getting Top-Level Summary Data for multiple Searches

Replace hashX with your search hashes

Use the schema to explore options & filters

query TopLevel($dimension: Dimension, $stat: Stat, $options: Option, $filter: Filter!, $metric: Metric!) {
  sentiments(dimension: $dimension, stat: $stat, options: $options, filter: $filter)
  visibility(metric: $metric, filter: $filter)
  reach(metric: $metric, filter: $filter)
  sources(dimension: $dimension, stat: $stat, options: $options, filter: $filter)
  contentTypes(dimension: $dimension, stat: $stat, options: $options, filter: $filter)
}
{
	"filter": {
		"searches": [
			"hash1",
			"hash2",
			"hash3"
		],
		"dateFrom": "2020-10-01T00:00:00Z",
		"dateTo": "2020-12-10T00:00:00Z"
	},
	"options": {},
	"metric": "COUNT"
}

Getting results batched into Posts and Reactions

Replace hashX with your search hash

query Results(
	$filter: Filter!
	$filter2: Filter!
	$options: Option
	$dimension: Dimension
) {
	posts: results(
		filter: $filter
		options: $options
		dimension: $dimension
	) {
		total
		results {
			publishedAt
			source
			content
		}
	}
	reactions: results(
		filter: $filter2
		options: $options
		dimension: $dimension
	) {
		total
		results {
			publishedAt
			source
			content
		}
	}
}
{
	"filter": {
		"dateFrom": "2022-09-01T00:00:00Z",
		"dateTo": "2022-09-12T00:00:00Z",
		"searches": [
			"hashX"
		],
		"contentType": "POST"
	},
	"filter2": {
		"dateFrom": "2022-09-01T00:00:00Z",
		"dateTo": "2022-09-12T00:00:00Z",
		"searches": [
			"hashX"
		],
		"contentType": "REACTIONS"
	}
}

Using Aliases to get Keywords by Data Source

Replace hashX with your search hash

A list of sources can be found here.

query keywordsBySource($twitter: Filter!, $facebook: Filter!, $instagram: Filter!, $reddit: Filter!) {
  twitter: keywords(filter: $twitter)
  facebook: keywords(filter: $facebook)
  instagram: keywords(filter: $instagram)
  reddit: keywords(filter: $reddit)
}
{
	"twitter": {
		"dateFrom": "2020-11-11T00:00:00Z",
		"dateTo": "2020-12-11T23:59:59Z",
		"searches": [
			"hash1"
		],
		"sources": [
			"TWITTER"
		]
	},
	"facebook": {
		"dateFrom": "2020-11-11T00:00:00Z",
		"dateTo": "2020-12-11T23:59:59Z",
		"searches": [
			"hash1"
		],
		"sources": [
			"FACEBOOK_PAGE"
		]
	},
	"instagram": {
		"dateFrom": "2020-11-11T00:00:00Z",
		"dateTo": "2020-12-11T23:59:59Z",
		"searches": [
			"hash1"
		],
		"sources": [
			"INSTAGRAM"
		]
	},
	"reddit": {
		"dateFrom": "2020-11-11T00:00:00Z",
		"dateTo": "2020-12-11T23:59:59Z",
		"searches": [
			"hash1"
		],
		"sources": [
			"REDDIT"
		]
	}
}

Getting results that match language and gender filters across multiple searches

Replace hashX with your search hash

A list of languages can be found here

query LangAndGender($filter: Filter!) {
  results(filter: $filter)
  {
    total
    results {
      content
      sharesCount
      emotion
    }
  }
}
{
"filter": {
		"searches": [
			"hash1",
			"hash2",
			"hash3",
			"hash4"
		],
		"dateFrom": "2020-05-04T00:00:00Z",
		"dateTo": "2020-09-15T00:00:00Z",
		"languages": [
			"EN"
		],
		"genders": [
			"MALE"
		]
	}
}

Replace hashX with your search hash

query ComplexResults($stat: Stat, $dimension: Dimension, $options: Option, $filter: Filter!) {
  results(stat: $stat, dimension: $dimension, options: $options, filter: $filter) {
    total
    results {
      createdAt
      content
      engagement
      sentiment
    }
  }
}
{
	"filter" : {
    "dateFrom" : "2020-11-11T00:00:00Z",
    "dateTo" : "2020-12-11T23:59:59Z",
    "searches" : [
      "hash1"
    ],
    "keywords" : "(holiday*  OR season* OR christmas OR \"winter time\" OR (festive AND drink)) AND -(party OR gathering OR buy OR store OR shop*)"
  }
}

Getting Filtered Results by Hashtags & Country

Replace hashX with your search hash

A list of countries can be found here

query FilteredbyHashtagandCountry($filter: Filter!) {
	results(filter: $filter) {
		total
		results {
			createdAt
			content
			sentiment
			impressions
			visibility
		}
	}
}
{
	"filter": {
		"dateFrom": "2022-05-24T00:00:00Z",
		"dateTo": "2022-05-26T23:59:59Z",
		"searches": [
			"hash1"
		],
		"countries": [
			"US"
			
		],
		"hashtags":
			"beer"
	}
}

CORE - Data Explorer

For all CORE queries, POST to this GraphQL endpoint URL:

https://data-explorer.pulsarplatform.com/graphql/core

Getting a List of Brands and Profiles within Brands

query BrandsPlusProfiles($page: Int, $limit: Int) {
  brands(page: $page, limit: $limit) {
    total
    nextPage
    brands {
      id
      name
      profiles {
        id
        source
        name
        plugged
      }
    }
  }
}
{
	"page": 1
}

Getting Average Engagement Data across multiple Profiles

query Engagements($filter: Filter!, $metric: ContentMetric) {
  engagements(filter : $filter, metric : $metric)
}
{
	"filter": {
		"dateFrom": "2020-10-11T00:00:00Z",
		"dateTo": "2020-11-11T23:59:59Z",
		"brandId": brandID,
		"profiles": [
			profID1,
			profID2,
			profID3
		]
  },
  "metric" : "AVG"
}

Getting Total Comment Count over Time

query comments($filter: Filter!, $metric: ContentMetric!) {
	comments(filter: $filter, metric: $metric)
}
{
    "filter": {
        "dateFrom": "2020-04-01T00:00:00Z",
        "dateTo": "2022-03-31T23:59:59Z",
        "brandId": brandID,
        "profiles": [
            profID1
        ]
    },
    "metric" : "SUM"
}

Getting the Total Count of Impressions across multiple profiles

query Impressions($filter: Filter!, $metric: ContentMetric) {
  impressions(filter : $filter, metric : $metric)
}
{			"filter": {
				"dateFrom": "2023-01-01T00:00:00Z",
				"dateTo": "2023-01-26T23:59:59Z",
				"brandId": brandId,
				"profiles": [
					profileID1,
					profileID2,
					profileID3
				]
			},
			"metric": "SUM"
		}

Getting Metrics of Posts from a Single Profile

query PostMetrics($filter: Filter!, $options: Option) {
	results(filter: $filter, options: $options) {
		results {
			commentsCount
			content
			engagement
			impressions
			likesCount
		}
		nextCursor #you'll need this to retrieve the next 50 results
	}
}
{
	"filter": {
		"dateFrom": "2022-05-11T00:00:00Z",
		"dateTo": "2022-05-12T23:59:59Z",
		"brandId": brandID,
		"profiles": [
			profileID
		]
	}
}

Getting the Total Post Count Over Time

query posts($filter: Filter!, $metric: ContentMetric!) {
	posts(filter: $filter, metric: $metric)
}
{
	"filter": {
		"dateFrom": "2022-05-11T00:00:00Z",
		"dateTo": "2022-05-12T23:59:59Z",
		"brandId": brandID,
		"profiles": [
			profileID
		]
	},
"metric" : "SUM"
}

Last updated