Ruby wrapper for Wistia's data API
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Wistia API Gem

Ruby wrapper for the Wistia Data API.

Useful as a wrapper for the Wistia::Media, Wistia::Project, Wistia::Projects::Sharing, and Wistia::Stats classes.

See for more info.

Required gems:

  • activeresource >= 2.3.8


gem install wistia-api

Basic Usage

Start by requiring Wistia and configuring your API password:

require 'wistia'
Wistia.password = 'your-api-password-here'

Configuration Options

Set the format of the API:

Wistia.format = 'json'  # This is the default.
Wistia.format = 'xml'

Read configuration from an external YAML file:


For an example YAML config, see spec/support/config.test.yml

Configure using a Hash:

Wistia.use_config!(:wistia => {
  :api => {
    :password => 'your-api-password',
    :format => 'xml-or-json'


List all Media in your account:


List all Projects in your account:


List all Sharing objects for a project:

Wistia::Projects::Sharing.find(:all, params: { project_id: 'YOUR_PROJECT_ID' })

Get stats for a project since December 1, 2012

Wistia::Stats::Project.get('YOUR_PROJECT_ID/by_date', start_date: '2012-12-01')

List Overall Stats for Your Account


Find Media based on media id in your account:

media = Wistia::Media.find('YOUR_MEDIA_ID')

so you can access all attributes of media through media object. # => 'video name'

also you can update media attributes through this object. = 'new video name'  # => true

Find Project based on project id in your account:

project = Wistia::Project.find('YOUR_PROJECT_ID')

so you can access all attributes of project through project object. # => 'project name'

also you can update project attributes through this object. = 'new project name' # => true


Copyright (c) 2011 Wistia, Inc. See LICENSE.txt for further details.