Title: | 'Brandwatch' API to R |
---|---|
Description: | Interact with the 'Brandwatch' API <https://developers.brandwatch.com/docs>. Allows you to authenticate to the API and obtain data for projects, queries, query groups tags and categories. Also allows you to directly obtain mentions and aggregate data for a specified query or query group. |
Authors: | Donal Phipps [aut, cre] |
Maintainer: | Donal Phipps <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.3.0 |
Built: | 2025-03-08 02:44:57 UTC |
Source: | https://github.com/phippsy/brandwatchr |
The brandwatchR package provides families of wrapper functions for the Brandwatch API.
bwr_auth
allows the user to authenticate and cache authentication information for future API calls.
bwr_projects_get
- get a dataframe of projects
bwr_query_get
- get a dataframe of queries for a project
bwr_query_check
- check the syntax of a query
bwr_query_create
- upload a new query
bwr_query_delete
- delete a specified query
bwr_mentions_get
- get the mentions for a specified query
bwr_mentions_total
- get the total number of mentions for a specified query or query group.
bwr_mentions_topics
- get the matching topics & topic metadata for a specified query or query group.
bwr_mentions_topsites
- get the top authors for a specified query or query group.
bwr_mentions_toptweeters
- get the top tweeters for a specified query or query group.
bwr_filters_get
- Get a data frame of all parameters which can be used to filter your query
bwr_metrics_get
- Get a data frame of all metrics which have limited accepted values.
bwr_querygrp_get
- get the query groups for a specified project
bwr_querygrp_delete
- delete a specfied query group
bwr_tag_get
- get the tags for a specified project
bwr_tag_create
- create a new tag for a specified project
bwr_tag_delete
- delete a tag for a specified project
bwr_cat_get
- get the categories for a specified project
bwr_cat_create
- create a new category for a specified project
Authenticates using specified username and password. Also caches a local version of the authentication token unless otherwise specified.
bwr_auth(un = NULL, pw = NULL, refresh = FALSE, cache = TRUE)
bwr_auth(un = NULL, pw = NULL, refresh = FALSE, cache = TRUE)
un |
Your Brandwatch Username |
pw |
Your Brandwatch Password |
refresh |
(Boolean) Should the token be refreshed? If no, a token will be read from a locally cached file '.bw_token' if this file is available. If no token is available, or the refresh argument is TRUE, a new token will be requested and cached from the API. |
cache |
(Boolean) Can the token be locally cached? If TRUE, the token will be cached in the current working directory in '.bw_token'. If FALSE, the token will be not be cached locally. |
Invisibly returns the string containing the token returned by Brandwatch. Your environment variable 'BW_TOKEN' will be set to the value of your authentication token.
## Not run: bwr_auth(un = '[email protected]', pw = 'itsasmallworld')
## Not run: bwr_auth(un = '[email protected]', pw = 'itsasmallworld')
Refer to https://developers.brandwatch.com/docs/creating-categories for more information. Unless otherwise specified, provide a single string argument.
bwr_cat_create(project_id = NULL, name = NULL, children = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_cat_create(project_id = NULL, name = NULL, children = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project ID into which you'd like to insert a category |
name |
The name of the category |
children |
A list of lists (sorry!), each list defining the key-value pairs for name (mandatory) and id (optional) of each child subcategory. |
token |
The authentication token, obtained using bwr_auth() |
Returns a list containing the JSON response from the server.
## Not run: bwr_cat_create(project_id = 12423432, name = 'Quick test cat', children = list(list(name = 'category one', id = 234234), list(name = 'category 2'))) ## End(Not run)
## Not run: bwr_cat_create(project_id = 12423432, name = 'Quick test cat', children = list(list(name = 'category one', id = 234234), list(name = 'category 2'))) ## End(Not run)
See the Brandwatch documentation for more information at https://developers.brandwatch.com/docs/retrieving-categories.
bwr_cat_get(project_id = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_cat_get(project_id = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project id you'd like to return all available categories for. Obtain a data frame of projects using bwr_get_projects() |
token |
The auth token for this user, which should be generated into an environment variable using bwr_auth() |
Returns a dataframe of categories matching the project.
## Not run: my_categories <- bwr_cat_get(project_id = 12334534)
## Not run: my_categories <- bwr_cat_get(project_id = 12334534)
See the Brandwatch documentation for more information at https://developers.brandwatch.com/docs/available-filters
bwr_filters_get(token = Sys.getenv("BW_TOKEN"))
bwr_filters_get(token = Sys.getenv("BW_TOKEN"))
token |
The auth token for this user, which should be generated into an environment variable using bwr_auth() |
Returns a dataframe of available filters
## Not run: my_queries <- bwr_query_get(project_id = 12334534)
## Not run: my_queries <- bwr_query_get(project_id = 12334534)
For more information, please refer to https://developers.brandwatch.com/docs/chart-dimensions-and-aggregates
bwr_mentions_chart(project_id = NULL, query_id = NULL, querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), aggregate = NULL, dimension1 = NULL, dimension2 = NULL, filters = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_mentions_chart(project_id = NULL, query_id = NULL, querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), aggregate = NULL, dimension1 = NULL, dimension2 = NULL, filters = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project id in which the specified query is contained. Obtain a list of project IDs using bwr_get_projects(). |
query_id |
The query ID you'd like to see tweeter data for. Note that you can only specify a query or a query group, not both. |
querygrp_id |
The query group ID you'd like to see total mentions for. Note that you can only specify a query or a query group, not both. |
date_range |
A character vector containing 2 date values in YYYY-mm-dd format. The first value is the beginning of your desired date range and the second value is the end of the date range. |
aggregate |
The numeric variable which you'd like to return results for (e.g. 'volume') |
dimension1 |
The first dimension which you'd like to split your data by (e.g. 'months') |
dimension2 |
The second dimension which you'd like to split your data by (e.g. 'countries') |
filters |
(Optional) A list of key-value pairs to filter the mentions query by. Use the bwr_filters_get() function to find out all available filters. |
token |
The authentication token, acquired using bwr_auth() |
Returns a data frame (including some list-columns) of the JSON results, aggregated according to your 2 dimensions.
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions_chart <- bwr_mentions_chart(project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01'), aggregate = "month", dimension1 = "sentiment", dimension2 = "volume") ## End(Not run)
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions_chart <- bwr_mentions_chart(project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01'), aggregate = "month", dimension1 = "sentiment", dimension2 = "volume") ## End(Not run)
Returns a data frame containing any results found for the specified query ID.
bwr_mentions_get(project_id = NULL, query_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), order_by = NULL, order_direction = NULL, filters = NULL, page = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_mentions_get(project_id = NULL, query_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), order_by = NULL, order_direction = NULL, filters = NULL, page = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
Numeric. The project id in which the specified query is contained. Obtain a list of project IDs using bwr_get_projects(). |
query_id |
Numeric The id of the query you'd like to run. Obtain a list of queries for any specified project using bwr_get_queries(). |
date_range |
A character vector containing 2 date values in YYYY-mm-dd format. The first value is the beginning of your desired date range and the second value is the end of the date range. |
order_by |
String. (Optional) The name of the metric you'd like to order your results by. |
order_direction |
String. Either 'asc' or 'desc', to specify ascending or descending order. |
filters |
(Optional) A list of key-value pairs to filter the mentions query by. Use the bwr_filters_get() function to find out all available filters. |
page |
Numeric, optional. The page number for which to return results. This is needed only when R needs to iterate through multiple pages of results from the Brandwatch API. It is recommended that you keep this value set as zero. |
token |
The authentication token, acquired using bwr_auth(). This token will be automatically obtained from the user's environment variable 'BW_TOKEN' and does not need to be provided. |
Returns a data frame containing all results
bwr_auth
to authenticate, bwr_projects_get
for a list of project IDs, bwr_query_get
for all queries available in the specified project.
bwr_filters_get
to get a list of available filters for the filters argument.
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_get(project_id = my_project, query_id = my_query, filters = list(gender = 'female', sentiment = 'neutral'), order_by = 'sentiment', order_direction = 'asc', date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_get(project_id = my_project, query_id = my_query, filters = list(gender = 'female', sentiment = 'neutral'), order_by = 'sentiment', order_direction = 'asc', date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
Get a dataframe of top author data for a specified Brandwatch query or query group
bwr_mentions_topauthors(project_id = NULL, query_id = NULL, querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), filters = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_mentions_topauthors(project_id = NULL, query_id = NULL, querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), filters = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project id in which the specified query is contained. Obtain a list of project IDs using bwr_get_projects(). |
query_id |
The query ID you'd like to see author data for. Note that you can only specify a query or a query group, not both. |
querygrp_id |
The query group ID you'd like to see total mentions for. Note that you can only specify a query or a query group, not both. |
date_range |
A character vector containing 2 date values in YYYY-mm-dd format. The first value is the beginning of your desired date range and the second value is the end of the date range. |
filters |
(Optional) A list of key-value pairs to filter the mentions query by. Use the bwr_filters_get() function to find out all available filters. |
token |
The authentication token, acquired using bwr_auth() |
Returns a data frame (including some list-columns) of the JSON results, showing information about the top authors related to your query.
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_topauthors(project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_topauthors(project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
Get a dataframe of topic data for a specified Brandwatch query or query group
bwr_mentions_topics(project_id = NULL, query_id = NULL, querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), order_by = NULL, limit = NULL, exclude_categories = NULL, exclude_tags = NULL, filters = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_mentions_topics(project_id = NULL, query_id = NULL, querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), order_by = NULL, limit = NULL, exclude_categories = NULL, exclude_tags = NULL, filters = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project id in which the specified query is contained. Obtain a list of project IDs using bwr_get_projects(). |
query_id |
The query ID you'd like to see total mentions for. Note that you can only specify a query or a query group, not both. |
querygrp_id |
The query group ID you'd like to see total mentions for. Note that you can only specify a query or a query group, not both. |
date_range |
A character vector containing 2 date values in YYYY-mm-dd format. The first value is the beginning of your desired date range and the second value is the end of the date range. |
order_by |
Metric by which you wish to order the topics returned. Can be either 'volume' (the number of Mentions the topic appears in) or 'burst' (the rate that the topic has emerged over time). |
limit |
The maximum number of topics to be returned. |
exclude_categories |
You have the option to exclude Categories from the topics returned (this is often done in the Brandwatch Analytics UI). |
exclude_tags |
The authentication token, acquired using bwr_auth() |
filters |
(Optional) A list of key-value pairs to filter the mentions query by. Use the bwr_filters_get() function to find out all available filters. |
token |
The authentication token, acquired using bwr_auth() |
Returns a data frame (including some list-columns) of the JSON results, showing information about topics related to your query.
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_topics(project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_topics(project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
Get a dataframe of top site data for a specified Brandwatch query or query group
bwr_mentions_topsites(project_id = NULL, query_id = NULL, querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), filters = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_mentions_topsites(project_id = NULL, query_id = NULL, querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), filters = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project id in which the specified query is contained. Obtain a list of project IDs using bwr_get_projects(). |
query_id |
The query ID you'd like to see total mentions for. Note that you can only specify a query or a query group, not both. |
querygrp_id |
The query group ID you'd like to see total mentions for. Note that you can only specify a query or a query group, not both. |
date_range |
A character vector containing 2 date values in YYYY-mm-dd format. The first value is the beginning of your desired date range and the second value is the end of the date range. |
filters |
(Optional) A list of key-value pairs to filter the mentions query by. Use the bwr_filters_get() function to find out all available filters. |
token |
The authentication token, acquired using bwr_auth() |
Returns a data frame (including some list-columns) of the JSON results, showing information about the top sites related to your query.
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_topsites(project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_topsites(project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
Get a dataframe of top Tweeter for a specified Brandwatch query or query group
bwr_mentions_toptweeters(project_id = NULL, query_id = NULL, querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), filters = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_mentions_toptweeters(project_id = NULL, query_id = NULL, querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), filters = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project id in which the specified query is contained. Obtain a list of project IDs using bwr_get_projects(). |
query_id |
The query ID you'd like to see tweeter data for. Note that you can only specify a query or a query group, not both. |
querygrp_id |
The query group ID you'd like to see total mentions for. Note that you can only specify a query or a query group, not both. |
date_range |
A character vector containing 2 date values in YYYY-mm-dd format. The first value is the beginning of your desired date range and the second value is the end of the date range. |
filters |
(Optional) A list of key-value pairs to filter the mentions query by. Use the bwr_filters_get() function to find out all available filters. |
token |
The authentication token, acquired using bwr_auth() |
Returns a data frame (including some list-columns) of the JSON results, showing information about the top tweeters related to your query.
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_toptweeters(project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_query_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_toptweeters(project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
Get the total mentions for a specified Brandwatch query or query group
bwr_mentions_total(project_id = NULL, query_id = NULL, querygrp_id = NULL, filters = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), token = Sys.getenv("BW_TOKEN"))
bwr_mentions_total(project_id = NULL, query_id = NULL, querygrp_id = NULL, filters = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1), token = Sys.getenv("BW_TOKEN"))
project_id |
The project id in which the specified query is contained. Obtain a list of project IDs using bwr_get_projects(). |
query_id |
The query ID you'd like to see total mentions for. Note that you can only specify a query or a query group, not both. |
querygrp_id |
The query group ID you'd like to see total mentions for. Note that you can only specify a query or a query group, not both. |
filters |
(Optional) A list of key-value pairs to filter the mentions query by. Use the bwr_filters_get() function to find out all available filters. |
date_range |
A character vector containing 2 date values in YYYY-mm-dd format. The first value is the beginning of your desired date range and the second value is the end of the date range. |
token |
The authentication token, acquired using bwr_auth() |
Returns a numeric vector of length 1 with the results.
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_queries_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_total( project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
## Not run: my_project <- bwr_projects_get()$id[1] my_query <- bwr_queries_get(project_id = my_project)$id[1] my_mentions <- bwr_mentions_total( project_id = my_project, query_id = my_query, date_range = c('2018-01-01', '2018-02-01')) ## End(Not run)
When examining parameters which can be used to filter a metric call, some parameters have a limited set of acceptable values. You can find out the current acceptable values using this function.
bwr_metrics_get(token = Sys.getenv("BW_TOKEN"))
bwr_metrics_get(token = Sys.getenv("BW_TOKEN"))
token |
The auth token for this user, which should be generated into an environment variable using bwr_auth() |
See the Brandwatch documentation for more information at https://developers.brandwatch.com/docs/available-filters
Returns a dataframe of available filters
## Not run: my_queries <- bwr_metrics_get(project_id = 12334534)
## Not run: my_queries <- bwr_metrics_get(project_id = 12334534)
#' Read the Brandwatch documentation for this API call at https://developers.brandwatch.com/docs/retrieving-projects
bwr_projects_get(target = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_projects_get(target = NULL, token = Sys.getenv("BW_TOKEN"))
target |
(Optional) the target for your query. If not specified, results will include all available projects for the authenticated user and all available data for each project. If 'summary', results will be a more simplified list of projects and excludes richer data such as query links. |
token |
The Brandwatch token, which will be automatically available via environment arguments provided you run bwr_auth() prior to any other functions. |
Returns a data frame of project data.
## Not run: my_projects <- bwr_get_projects(target = 'summary')
## Not run: my_projects <- bwr_get_projects(target = 'summary')
Validate a Brandwatch query
bwr_query_check(query = list(), token = Sys.getenv("BW_TOKEN"))
bwr_query_check(query = list(), token = Sys.getenv("BW_TOKEN"))
query |
A list containing named parameters: query and language. |
token |
The authentication token, acquired using bwr_auth() |
Returns a list containing any errors or issues, if found
## Not run: any_issues <- bwr_query_check(query = list(query = 'at_mentions:huey', language = 'en'))
## Not run: any_issues <- bwr_query_check(query = list(query = 'at_mentions:huey', language = 'en'))
Refer to https://developers.brandwatch.com/docs/creating-queries for more information. Unless otherwise specified, provide a single string argument.
bwr_query_create(project_id = NULL, type = "search string", languageAgnostic = FALSE, samplePercent = 100, languages = "en", includedTerms = NULL, name = NULL, description = "My API query", industry = "general", token = Sys.getenv("BW_TOKEN"))
bwr_query_create(project_id = NULL, type = "search string", languageAgnostic = FALSE, samplePercent = 100, languages = "en", includedTerms = NULL, name = NULL, description = "My API query", industry = "general", token = Sys.getenv("BW_TOKEN"))
project_id |
The project ID into which you'd like to insert a query |
type |
The type of query (e.g. 'search string') |
languageAgnostic |
(Boolean) Is the query language agnostic? |
samplePercent |
(Numeric) The sample percent for the given query |
languages |
Which languages to include |
includedTerms |
The query syntax to be included. |
name |
The name of the query |
description |
The description of the query |
industry |
The industry classification |
token |
The authentication token, obtained using bwr_auth() |
Returns a list containing the JSON response from the server.
## Not run: bwr_query_create(project_id = 12423432, samplePercent = 50, includedTerms = 'at_mentions:mickeymouse', name = 'Sample API query') ## End(Not run)
## Not run: bwr_query_create(project_id = 12423432, samplePercent = 50, includedTerms = 'at_mentions:mickeymouse', name = 'Sample API query') ## End(Not run)
Delete a specified Brandwatch query
bwr_query_delete(project_id, query_id, token = Sys.getenv("BW_TOKEN"))
bwr_query_delete(project_id, query_id, token = Sys.getenv("BW_TOKEN"))
project_id |
The project ID in which the target query can be found. Obtain a data frame of project IDs using bwr_projects_get(). |
query_id |
The ID of the query which you'd like to delete. Obtain a list of query IDs using bwr_query_get(). |
token |
The authentication token, obtained using bwr_auth() |
Returns a list of the JSON response.
## Not run: bwr_query_delete(project_id = 122445, query_id = 23432424)
## Not run: bwr_query_delete(project_id = 122445, query_id = 23432424)
See the Brandwatch documentation for more information at https://developers.brandwatch.com/docs/retrieving-queries.
bwr_query_get(project_id = NULL, type = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_query_get(project_id = NULL, type = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project id you'd like to return all available queries for. Obtain a data frame of projects using bwr_get_projects() |
type |
(Optional) The type of query you'd like to return. If not specified, the API will return all available queries for the given project. Currently, results don't seem to be affected by the type parameter - the API appears to return full results in all cases. |
token |
The auth token for this user, which should be generated into an environment variable using bwr_auth() |
Returns a dataframe of queries matching the project.
## Not run: my_queries <- bwr_query_get(project_id = 12334534)
## Not run: my_queries <- bwr_query_get(project_id = 12334534)
Delete a specified Brandwatch query group
bwr_querygrp_delete(project_id = NULL, group_id = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_querygrp_delete(project_id = NULL, group_id = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project ID in which your target query group can be found. |
group_id |
The query group ID which you'd like to delete. Find out the list of query groups in a given project using bwr_querygrp_get(). |
token |
The API authentication token, obtained using bwr_auth() |
Returns a list of the JSON response from the server.
## Not run: kill <- bwr_querygrp_delete(project_id = 234234234, group_id = 23423423)
## Not run: kill <- bwr_querygrp_delete(project_id = 234234234, group_id = 23423423)
Get a data frame of Brandwatch query groups in the specified project
bwr_querygrp_get(project_id = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_querygrp_get(project_id = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project ID whose query groups you'd like to return |
token |
The authentication token, obtained using bwr_auth() |
Returns a data frame of the query groups for the given project, if any exist.
## Not run: groups <- bwr_querygrp_get(project_id = 21343242)
## Not run: groups <- bwr_querygrp_get(project_id = 21343242)
Delete a specified Brandwatch rule
bwr_rule_delete(project_id, rule_id, token = Sys.getenv("BW_TOKEN"))
bwr_rule_delete(project_id, rule_id, token = Sys.getenv("BW_TOKEN"))
project_id |
The project ID in which the target rule can be found. Obtain a data frame of project IDs using bwr_projects_get(). |
rule_id |
The ID of the rule which you'd like to delete. Obtain a list of rule IDs using bwr_rule_get(). |
token |
The authentication token, obtained using bwr_auth() |
Returns a list of the JSON response.
## Not run: bwr_rule_delete(project_id = 122445, rule_id = 23432424)
## Not run: bwr_rule_delete(project_id = 122445, rule_id = 23432424)
See the Brandwatch documentation for more information at https://developers.brandwatch.com/docs/retrieving-rules.
bwr_rule_get(project_id = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_rule_get(project_id = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project id you'd like to return all available rules for. Obtain a data frame of projects using bwr_get_projects() |
token |
The auth token for this user, which should be generated into an environment variable using bwr_auth() |
Returns a dataframe of rules matching the project. Due to the structure of the API response, some of the dataframe columns are list-columns (i.e. nested dataframes).
## Not run: my_rules <- bwr_rules_get(project_id = 12334534)
## Not run: my_rules <- bwr_rules_get(project_id = 12334534)
Refer to https://developers.brandwatch.com/docs/creating-tags for more information. Unless otherwise specified, provide a single string argument.
bwr_tag_create(project_id = NULL, name = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_tag_create(project_id = NULL, name = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project ID into which you'd like to insert a tag |
name |
The name of the tag |
token |
The authentication token, obtained using bwr_auth() |
Returns a list containing the JSON response from the server.
## Not run: bwr_tag_create(project_id = 12423432, name = 'Quick test tag')
## Not run: bwr_tag_create(project_id = 12423432, name = 'Quick test tag')
Delete a specified Brandwatch tag
bwr_tag_delete(project_id, tag_id, token = Sys.getenv("BW_TOKEN"))
bwr_tag_delete(project_id, tag_id, token = Sys.getenv("BW_TOKEN"))
project_id |
The project ID in which the target tag can be found. Obtain a data frame of project IDs using bwr_projects_get(). |
tag_id |
The ID of the tag which you'd like to delete. Obtain a list of tag IDs using bwr_tag_get(). |
token |
The authentication token, obtained using bwr_auth() |
Returns a list of the JSON response.
## Not run: bwr_tag_delete(project_id = 122445, tag_id = 23432424)
## Not run: bwr_tag_delete(project_id = 122445, tag_id = 23432424)
See the Brandwatch documentation for more information at https://developers.brandwatch.com/docs/retrieving-tags.
bwr_tag_get(project_id = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_tag_get(project_id = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project id you'd like to return all available tags for. Obtain a data frame of projects using bwr_get_projects() |
token |
The auth token for this user, which should be generated into an environment variable using bwr_auth() |
Returns a dataframe of tags matching the project.
## Not run: my_tags <- bwr_tag_get(project_id = 12334534)
## Not run: my_tags <- bwr_tag_get(project_id = 12334534)
Refer to https://developers.brandwatch.com/docs/retrieving-workflow for more information.
bwr_wf_get(project_id = NULL, token = Sys.getenv("BW_TOKEN"))
bwr_wf_get(project_id = NULL, token = Sys.getenv("BW_TOKEN"))
project_id |
The project id in which the specified workflow is contained. Obtain a list of project IDs using bwr_get_projects(). |
token |
The authentication token, acquired using bwr_auth() |
Returns a list containing all results
## Not run: my_project <- bwr_get_projects()$id[1] my_workflow <- bwr_wf_get(project_id = my_project) ## End(Not run)
## Not run: my_project <- bwr_get_projects()$id[1] my_workflow <- bwr_wf_get(project_id = my_project) ## End(Not run)