wave: Access WebAIM WAVE Accessibility API

View source: R/wave.R

waveR Documentation

Access WebAIM WAVE Accessibility API

Description

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.

Usage

wave(
  key,
  url,
  format = NULL,
  viewportwidth = NULL,
  reporttype = NULL,
  username = NULL,
  password = NULL,
  useragent = NULL,
  toDataframe = FALSE,
  file = NULL
)

Arguments

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

Value

List or tibble containing WAVE analysis results

Examples

## 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)

waetr documentation built on April 16, 2025, 5:11 p.m.