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?

Drop us a note.

No matter where you are in the planning process, we’re happy to help, and we’re actual humans here on the other side of the form. 👋 We’re here to discuss your challenges and plans, evaluate your existing resources or a potential partner, or even make some initial recommendations. And, of course, we’re here to help any time you’re in the market for some robust WordPress awesomeness.