Type: | Package |
Title: | Access 'Fortnite Ecosystem' API |
Version: | 0.1.0 |
Author: | Phillip Black [aut, cre] |
Maintainer: | Phillip Black <pblack@gameeconomistconsulting.com> |
Description: | Interface for accessing the 'Fortnite Ecosystem' API, allowing users to retrieve island metadata and engagement metrics. The package provides functions to search for 'Fortnite Creative' islands, retrieve detailed metadata about specific islands including titles, descriptions, and tags, and access engagement metrics such as daily active users and play duration. It supports pagination for large result sets and time-series analysis of island performance. The API endpoint is https://api.fortnite.com/ecosystem/v1. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Depends: | R (≥ 4.1.0) |
Imports: | httr2, tibble, dplyr, purrr |
Suggests: | testthat (≥ 3.0.0), rhub, rcmdcheck |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2025-07-24 08:29:05 UTC; phillip |
Repository: | CRAN |
Date/Publication: | 2025-07-29 13:30:02 UTC |
Create request for Fortnite Ecosystem API
Description
Create request for Fortnite Ecosystem API
Usage
fortnite_request(endpoint = "")
Arguments
endpoint |
API endpoint (appended to base URL) |
Value
An httr2 request object
Examples
# Example showing request structure
endpoint <- "islands"
# This would construct an httr2 request object
## Not run:
req <- fortnite_request("islands")
## End(Not run)
Get all islands with pagination support
Description
Get all islands with pagination support
Usage
get_all_islands(max_pages = 10, page_size = 100)
Arguments
max_pages |
Maximum number of pages to fetch (default: 10) |
page_size |
Number of islands per page (default: 100) |
Value
A tibble with all island data
Examples
# Example showing expected output structure
mock_all_islands <- tibble::tibble(
code = c("1234-5678-9012", "2345-6789-0123"),
title = c("Island 1", "Island 2"),
page_fetched = c(1, 1)
)
# In practice, this would aggregate results from multiple API pages
## Not run:
# Get all islands (up to 1000)
all_islands <- get_all_islands()
# Get more islands
many_islands <- get_all_islands(max_pages = 20)
## End(Not run)
Get specific island metadata
Description
Get specific island metadata
Usage
get_island_metadata(code)
Arguments
code |
Island code (e.g., "XXXX-XXXX-XXXX") |
Value
A list with detailed island metadata
Examples
# Example with mock metadata structure
mock_metadata <- list(
code = "1234-5678-9012",
title = "Mock Island",
description = "A test island",
tags = c("adventure", "multiplayer")
)
# In practice, this would come from the API
## Not run:
island <- get_island_metadata("1234-5678-9012")
## End(Not run)
Get island engagement metrics
Description
Get island engagement metrics
Usage
get_island_metrics(code, start_date, end_date, interval = "day")
Arguments
code |
Island code |
start_date |
Start date for metrics (Date or character) |
end_date |
End date for metrics (Date or character) |
interval |
Time interval ("minute", "hour", "day") |
Value
A tibble with engagement metrics
Examples
# Example with mock metrics structure
mock_metrics <- tibble::tibble(
date = as.Date(c("2024-01-01", "2024-01-02")),
dau = c(1000, 1200),
play_duration = c(45.5, 48.2)
)
# In practice, this would come from the API
## Not run:
metrics <- get_island_metrics(
code = "1234-5678-9012",
start_date = Sys.Date() - 7,
end_date = Sys.Date(),
interval = "day"
)
## End(Not run)
Get list of Fortnite Creative islands
Description
Get list of Fortnite Creative islands
Usage
get_islands(limit = 50, offset = 0, order_by = "plays", order = "desc")
Arguments
limit |
Maximum number of results (default: 50) |
offset |
Number of results to skip |
order_by |
Field to order by ("plays", "lastPlayed", etc.) |
order |
Sort order ("asc" or "desc") |
Value
A tibble with island data
Examples
# Example with mock response
mock_response <- list(
islands = list(
list(code = "1234-5678-9012", title = "Mock Island"),
list(code = "2345-6789-0123", title = "Test Island")
)
)
# In practice, this would come from the API
## Not run:
islands <- get_islands(limit = 50)
## End(Not run)