Travis-CI Build Status

craigr: an R package to get data from craigslist

The purpose of this package is to obtain data from any section of craigslist and load it into a clean data.frame within R. Currently this only works with apartment searches. See the "Package status" below.

Install

devtools::install_github("adletaw/craigr")

Note that the package depends on: rvest, stringr, xml2, RCurl and magrittr

Package status

This package is under passive development. Currently, you can download housing rental data only.

Usage

Finding available rentals

craigr will do an apartment search using the function rentals. You can supply almost any search parameters that are available on craiglist. See the help page for rentals to get the full parameter list.

First you have to specify the location and area. The location works as the Craigslist subdomain, e.g. seattle.craigslist.org. The area allows you to filter to a more specific location according to the pre-programmed three-letter codes in Craigslist. For example, using see limits the search to the Seattle city limits only. The default is all.

results <- craigr::rentals(location = "seattle", area = "see", 
                           max_results = 100)

head(results)

The listing title, price, data and url are provided. Check craigslist to find the location subdomain and three-letter area code.



adletaw/craigr documentation built on Feb. 21, 2020, 10:14 p.m.