Title: | Access the Clash of Clans API |
---|---|
Description: | Interfaces with the official API for Clash of Clans <https://developer.clashofclans.com/#/>. Provides tools to work with players, clans, wars, raids, and other game events. All outputs are provided in a tidy format, where each player, clan, or attack is an observation. |
Authors: | Christopher T. Kenny [aut, cre] |
Maintainer: | Christopher T. Kenny <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1 |
Built: | 2024-11-18 03:53:30 UTC |
Source: | https://github.com/christopherkenny/clash |
Get information for one Builder Base league
coc_get_builderbase_league( league, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_builderbase_league( league, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
league |
league id, such as 44000041 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_builderbase_league(league = '44000041', limit = 10)
coc_get_builderbase_league(league = '44000041', limit = 10)
Get Builder Base Leagues
coc_get_builderbase_leagues( limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_builderbase_leagues( limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_builderbase_leagues(limit = 10)
coc_get_builderbase_leagues(limit = 10)
Get information for one capital league
coc_get_capital_league( league, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_capital_league( league, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
league |
league id, such as 85000022 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_capital_league(league = '85000022', limit = 10)
coc_get_capital_league(league = '85000022', limit = 10)
Get Capital Leagues
coc_get_capital_leagues( limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_capital_leagues( limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_capital_leagues(limit = 10)
coc_get_capital_leagues(limit = 10)
Get Capital Raid Seasons
coc_get_capital_raid_seasons( clan, limit = NULL, after = NULL, before = NULL, key = get_clash_key() )
coc_get_capital_raid_seasons( clan, limit = NULL, after = NULL, before = NULL, key = get_clash_key() )
clan |
Required. Clan tag. |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_capital_raid_seasons(clan = '8UC2J90Y')
coc_get_capital_raid_seasons(clan = '8UC2J90Y')
Gets full clan details
coc_get_clan(clan, key = get_clash_key())
coc_get_clan(clan, key = get_clash_key())
clan |
Required. Clan tag. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation
Default: |
a tibble
with each row as a player
coc_get_clan(clan = '8UC2J90Y')
coc_get_clan(clan = '8UC2J90Y')
Get clan labels
coc_get_clan_labels( limit = NULL, after = NULL, before = NULL, key = get_clash_key() )
coc_get_clan_labels( limit = NULL, after = NULL, before = NULL, key = get_clash_key() )
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashroyale.com/#/documentation
Default: |
tibble of card info
coc_get_clan_labels()
coc_get_clan_labels()
Get current clan members
coc_get_clan_members( clan, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_clan_members( clan, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
clan |
Required. Clan tag. |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_clan_members(clan = '8UC2J90Y')
coc_get_clan_members(clan = '8UC2J90Y')
Search Clans
coc_get_clan_search( name = NULL, location_id = NULL, war_frequency = NULL, min_members = NULL, max_members = NULL, min_clan_points = NULL, min_clan_level = NULL, limit = NULL, after = NULL, before = NULL, label_ids = NULL, key = get_clash_key() )
coc_get_clan_search( name = NULL, location_id = NULL, war_frequency = NULL, min_members = NULL, max_members = NULL, min_clan_points = NULL, min_clan_level = NULL, limit = NULL, after = NULL, before = NULL, label_ids = NULL, key = get_clash_key() )
name |
Search clans by name |
location_id |
Filter by clan location identifier |
war_frequency |
Filter by war frequency |
min_members |
Filter by minimum number of clan members |
max_members |
Filter by maximum number of clan members |
min_clan_points |
minimum amount of clan points |
min_clan_level |
minimum clan level |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
label_ids |
comma separated vector to filter results by |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
a tibble
with each row as a player
coc_get_clan_search('Dusty Death', limit = 5)
coc_get_clan_search('Dusty Death', limit = 5)
Get Gold Pass Season Information
coc_get_goldpass(key = get_clash_key())
coc_get_goldpass(key = get_clash_key())
key |
Required. API key. See https://developer.clashroyale.com/#/documentation
Default: |
a tibble
of gold pass info
coc_get_goldpass()
coc_get_goldpass()
Get information for one league
coc_get_league( league, season, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_league( league, season, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
league |
league id, such as 29000022 |
season |
season id, such as '2022-09' |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_league(league = '29000022', season = '2022-09', limit = 10)
coc_get_league(league = '29000022', season = '2022-09', limit = 10)
Get seasons for one league
coc_get_league_seaons( league, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_league_seaons( league, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
league |
league id, such as 29000022 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_league_seaons(league = '29000022', limit = 10)
coc_get_league_seaons(league = '29000022', limit = 10)
Get Leagues
coc_get_leagues(limit = NULL, after = NULL, before = NULL, key = coc_get_key())
coc_get_leagues(limit = NULL, after = NULL, before = NULL, key = coc_get_key())
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_leagues(limit = 10)
coc_get_leagues(limit = 10)
Get information for one location
coc_get_location( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_location( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
location |
location id, such as 32000249 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble of card info
coc_get_location(location = 32000249)
coc_get_location(location = 32000249)
Get Locations
coc_get_locations( limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_locations( limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble of card info
coc_get_locations()
coc_get_locations()
Gets the player details for one player.
coc_get_player(tag, key = get_clash_key())
coc_get_player(tag, key = get_clash_key())
tag |
Required. The player to return. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation
Default: |
a tibble
of player info
coc_get_player('92GCQQYP')
coc_get_player('92GCQQYP')
Get player labels
coc_get_player_labels( limit = NULL, after = NULL, before = NULL, key = get_clash_key() )
coc_get_player_labels( limit = NULL, after = NULL, before = NULL, key = get_clash_key() )
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashroyale.com/#/documentation
Default: |
tibble of card info
coc_get_player_labels()
coc_get_player_labels()
Get Builder Base Clan Rankings
coc_get_ranking_builderbase_clans( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_ranking_builderbase_clans( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
location |
location id, such as 32000249 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble of card info
coc_get_ranking_builderbase_clans(location = 32000249)
coc_get_ranking_builderbase_clans(location = 32000249)
Get Builder Base Player Rankings
coc_get_ranking_builderbase_players( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_ranking_builderbase_players( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
location |
location id, such as 32000249 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble of card info
coc_get_ranking_builderbase_players(location = 32000249)
coc_get_ranking_builderbase_players(location = 32000249)
Get Capitals Rankings
coc_get_ranking_capitals( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_ranking_capitals( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
location |
location id, such as 32000249 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble of card info
coc_get_ranking_capitals(location = 32000249)
coc_get_ranking_capitals(location = 32000249)
Get Clan Rankings
coc_get_ranking_clans( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_ranking_clans( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
location |
location id, such as 32000249 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble of card info
coc_get_ranking_clans(location = 32000249)
coc_get_ranking_clans(location = 32000249)
Get Player Rankings
coc_get_ranking_players( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_ranking_players( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
location |
location id, such as 32000249 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble of card info
coc_get_ranking_players(location = 32000249)
coc_get_ranking_players(location = 32000249)
Get Versus Clan Rankings
coc_get_ranking_versus_clans( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_ranking_versus_clans( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
location |
location id, such as 32000249 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble of card info
coc_get_ranking_versus_clans(location = 32000249)
coc_get_ranking_versus_clans(location = 32000249)
Get Versus Player Rankings
coc_get_ranking_versus_players( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_ranking_versus_players( location, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
location |
location id, such as 32000249 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble of card info
coc_get_ranking_versus_players(location = 32000249)
coc_get_ranking_versus_players(location = 32000249)
Get current Clan War
coc_get_war_current( clan, limit = NULL, after = NULL, before = NULL, key = get_clash_key() )
coc_get_war_current( clan, limit = NULL, after = NULL, before = NULL, key = get_clash_key() )
clan |
Required. Clan tag. |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_war_current(clan = '8UC2J90Y')
coc_get_war_current(clan = '8UC2J90Y')
Get information for one war league
coc_get_war_league( league, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_war_league( league, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
league |
league id, such as 48000018 |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_war_league(league = 48000018, limit = 10)
coc_get_war_league(league = 48000018, limit = 10)
Get War Leagues
coc_get_war_leagues( limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_war_leagues( limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_war_leagues(limit = 10)
coc_get_war_leagues(limit = 10)
Get Clan War Log
coc_get_war_log( clan, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
coc_get_war_log( clan, limit = NULL, after = NULL, before = NULL, key = coc_get_key() )
clan |
Required. Clan tag. |
limit |
number of items returned in the response. |
after |
return only items that occur after this marker. |
before |
return only items that occur before this marker. |
key |
Required. API key. See https://developer.clashofclans.com/#/documentation.
Default: |
tibble
with list columns for clan, clans, and history.
coc_get_war_log(clan = '8UC2J90Y')
coc_get_war_log(clan = '8UC2J90Y')
Check or Get Clash of Clans API Key
has_clash_key() get_clash_key() coc_get_key() coc_has_key()
has_clash_key() get_clash_key() coc_get_key() coc_has_key()
logical if has
, key if get
has_clash_key()
has_clash_key()
Adds Clash of Clans API key to .Renviron.
set_clash_key(key, overwrite = FALSE, install = FALSE) coc_set_key(key, overwrite = FALSE, install = FALSE)
set_clash_key(key, overwrite = FALSE, install = FALSE) coc_set_key(key, overwrite = FALSE, install = FALSE)
key |
Character. API key to add to add. |
overwrite |
Defaults to FALSE. Boolean. Should existing |
install |
Defaults to FALSE. Boolean. Should this be added '~/.Renviron' file? |
key, invisibly
## Not run: set_clash_key('1234') ## End(Not run)
## Not run: set_clash_key('1234') ## End(Not run)