Get the WP.com stats as CSV

Strings containing double quotes, commas, or “n” are enclosed in double-quotes. Double-quotes in strings are escaped by inserting another double-quote. Example: “pet food” recipe Becomes: “””pet food”” recipe”


Name Type Description
$table string Optional. Table for stats can be views, postviews, referrers, searchterms, clicks. Default is views.
$end_data string Optional. The last day of the desired time frame. Format is 'Y-m-d' (e.g. 2007-05-01) and default is UTC date.
$num_days int Optional. The length of the desired time frame. Default is 1. Maximum 90 days
$and string Optional. Possibility to refine the query with additional AND condition. Usually unused.
$limit int Optional. The maximum number of records to return. Default is 5. Maximum 100.
$summarize bool Optional. If present, summarizes all matching records.

Return Value

string: Result format is CSV with one row per line and column names in first row.

Ready to get started?

Tell us about your needs

Let us lead the way. We’ll help you select a top tier development partner. We’ll train your developers, operations, infrastructure, and editorial teams. We’ll coarchitect your deployment processes. We will provide live support for peak events. We’ll help your people avoid dark alleys and blind corners, and reduce wasted cycles.