mobdb_extract_urls: Extract download URLs from feed results

View source: R/utils-helpers.R

mobdb_extract_urlsR Documentation

Extract download URLs from feed results

Description

Helper function to extract producer URLs from a tibble of feeds returned by feeds() or mobdb_search(). This is useful when you want to get all the source URLs from a set of search results.

Usage

mobdb_extract_urls(feeds)

Arguments

feeds

A tibble returned by feeds() or mobdb_search().

Value

A character vector of download URLs, with the same length as the input tibble. Returns NA for feeds without a URL.

Examples

# Create sample data matching feeds() output structure
sample_feeds <- tibble::tibble(
  id = c("mdb-1", "mdb-2"),
  provider = c("Agency A", "Agency B"),
  source_info = tibble::tibble(
    producer_url = c("https://example.com/feed1.zip", "https://example.com/feed2.zip"),
    authentication_type = c(0L, 0L)
  )
)

# Extract URLs from sample data
mobdb_extract_urls(sample_feeds)


# With real API data:
ca_gtfs <- feeds(subdivision_name = "California", data_type = "gtfs")
ca_urls <- mobdb_extract_urls(ca_gtfs)


mobdb documentation built on Aug. 29, 2026, 1:07 a.m.