| Title: | 'WebAIM' 'WAVE' Accessibility Evaluation Tool |
|---|---|
| Description: | An R interface to the 'WebAIM' 'WAVE' accessibility evaluation API <https://wave.webaim.org/api/>. This package provides tools for analyzing web pages for accessibility issues, generating reports, and comparing accessibility across multiple websites. |
| Authors: | Benjamin Listyg [aut, cre], Brennah V. Ross [aut] |
| Maintainer: | Benjamin Listyg <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-13 07:46:02 UTC |
| Source: | https://github.com/benjaminlistyg/waetr |
Checks remaining WAVE API credits for the provided key
check_wave_credits(api_key)check_wave_credits(api_key)
api_key |
Character string. WAVE API key |
Numeric value of remaining credits
## Not run: credits <- check_wave_credits("your_api_key") print(sprintf("Remaining credits: %d", credits)) ## End(Not run)## Not run: credits <- check_wave_credits("your_api_key") print(sprintf("Remaining credits: %d", credits)) ## End(Not run)
Main function to generate accessibility comparisons across multiple websites
compare_accessibility( input, api_key = NULL, site_names = NULL, plot_type = c("category_counts", "issues", "structure"), report_type = 1, theme = "light" )compare_accessibility( input, api_key = NULL, site_names = NULL, plot_type = c("category_counts", "issues", "structure"), report_type = 1, theme = "light" )
input |
Character vector. URLs to analyze or paths to JSON files |
api_key |
Character string. WAVE API key (required for URL analysis) |
site_names |
Character vector. Optional custom names for sites |
plot_type |
Character string. Type of visualization:
|
report_type |
Integer. WAVE report type (1-4) |
theme |
Character string. Visual theme for plot (default: "light") |
ggplot object containing the requested visualization
## Not run: # Compare multiple websites p <- compare_accessibility( input = c("https://example.com", "https://example.org"), api_key = "your_api_key", plot_type = "category_counts" ) # Save the plot to a temporary directory ggsave(file.path(tempdir(), "accessibility_comparison.png"), p) ## End(Not run)## Not run: # Compare multiple websites p <- compare_accessibility( input = c("https://example.com", "https://example.org"), api_key = "your_api_key", plot_type = "category_counts" ) # Save the plot to a temporary directory ggsave(file.path(tempdir(), "accessibility_comparison.png"), p) ## End(Not run)
Generates a complete accessibility report with visualizations and summary data
create_accessibility_report( input, api_key = NULL, output_dir = NULL, report_type = 1, include_plots = TRUE, custom_theme = "light" )create_accessibility_report( input, api_key = NULL, output_dir = NULL, report_type = 1, include_plots = TRUE, custom_theme = "light" )
input |
Character vector. URLs to analyze or paths to JSON files |
api_key |
Character string. WAVE API key (required for URL analysis) |
output_dir |
Character string. Directory to save report files |
report_type |
Integer. WAVE report type (1-4) |
include_plots |
Logical. Whether to include plots in the report (default: TRUE) |
custom_theme |
Character string. Visual theme for plots (default: "light") |
List containing plots and summary data frame
## Not run: report <- create_accessibility_report( input = c("https://example.com", "https://example.org"), api_key = "your_api_key", output_dir = tempdir() ) ## End(Not run)## Not run: report <- create_accessibility_report( input = c("https://example.com", "https://example.org"), api_key = "your_api_key", output_dir = tempdir() ) ## End(Not run)
Retrieves accessibility analysis data either from WAVE API or local JSON files
fetch_wave_data( input, api_key = NULL, report_type = 1, is_json = FALSE, delay = 1 )fetch_wave_data( input, api_key = NULL, report_type = 1, is_json = FALSE, delay = 1 )
input |
Character vector. Either URLs to analyze or paths to JSON files |
api_key |
Character string. WAVE API key (required for URL analysis) |
report_type |
Integer. WAVE report type (1-4):
|
is_json |
Logical. Whether input contains JSON file paths (default: FALSE) |
delay |
Numeric. Delay between API calls in seconds (default: 1) |
List of WAVE analysis results
## Not run: # Fetch from URLs results <- fetch_wave_data( input = c("https://example.com", "https://example.org"), api_key = "your_api_key" ) # Load from JSON files json_results <- fetch_wave_data( input = c("site1.json", "site2.json"), is_json = TRUE ) ## End(Not run)## Not run: # Fetch from URLs results <- fetch_wave_data( input = c("https://example.com", "https://example.org"), api_key = "your_api_key" ) # Load from JSON files json_results <- fetch_wave_data( input = c("site1.json", "site2.json"), is_json = TRUE ) ## End(Not run)
This function provides an interface to the WebAIM WAVE accessibility evaluation API. It allows you to analyze web pages for accessibility issues and retrieve detailed reports.
wave( key, url, format = NULL, viewportwidth = NULL, reporttype = NULL, username = NULL, password = NULL, useragent = NULL, toDataframe = FALSE, file = NULL )wave( key, url, format = NULL, viewportwidth = NULL, reporttype = NULL, username = NULL, password = NULL, useragent = NULL, toDataframe = FALSE, file = NULL )
key |
Character string. Your WAVE API key |
url |
Character string. URL of the webpage to analyze |
format |
Character string. Response format (optional) |
viewportwidth |
Integer. Viewport width for analysis (optional) |
reporttype |
Integer. Type of report to generate (1-4) (optional) |
username |
Character string. Username for protected pages (optional) |
password |
Character string. Password for protected pages (optional) |
useragent |
Character string. Custom user agent (optional) |
toDataframe |
Logical. Whether to convert results to a data frame (default: FALSE) |
file |
Character string. Optional file path to save JSON results |
List or tibble containing WAVE analysis results
## Not run: # Basic usage results <- wave(key = "your_api_key", url = "https://example.com") # Get results as a data frame df_results <- wave(key = "your_api_key", url = "https://example.com", toDataframe = TRUE) # Save results to a temporary file tmp_file <- file.path(tempdir(), "wave_results.json") wave(key = "your_api_key", url = "https://example.com", file = tmp_file) ## End(Not run)## Not run: # Basic usage results <- wave(key = "your_api_key", url = "https://example.com") # Get results as a data frame df_results <- wave(key = "your_api_key", url = "https://example.com", toDataframe = TRUE) # Save results to a temporary file tmp_file <- file.path(tempdir(), "wave_results.json") wave(key = "your_api_key", url = "https://example.com", file = tmp_file) ## End(Not run)