Skip to content

API Reference

Vimeify provides comprehensive PHP functions and REST API endpoints for programmatic video management.

PHP Functions

Video Functions

Get Video by ID

php
vimeify_get_video( int $post_id )

Get video post by WordPress post ID.

Returns: WP_Post object or null

Example:

php
$video = vimeify_get_video( 123 );
if ( $video ) {
    echo $video->post_title;
}

Get Video by Vimeo ID

php
vimeify_get_video_by_vimeo_id( string $vimeo_id )

Get video by Vimeo ID.

Returns: WordPress post ID or null

Get Video Metadata

php
vimeify_get_video_meta( int $post_id, string $key = '' )

Get video metadata.

Returns: Meta value or array

Available Meta Keys:

  • vimeo_id - Vimeo video ID
  • duration - Duration in seconds
  • width - Video width
  • height - Video height
  • embed_url - Vimeo embed URL
  • privacy - Privacy setting
  • thumbnail - Thumbnail URLs

Get Video Embed

php
vimeify_get_video_embed( int $post_id, array $args = [] )

Get video embed HTML.

Args:

  • width - Player width (default: 640)
  • height - Player height (default: 360)
  • autoplay - Auto-play video (default: false)
  • loop - Loop video (default: false)

Returns: HTML embed code

php
vimeify_get_gallery( int $gallery_id )

Get gallery by ID.

php
vimeify_get_gallery_videos( int $gallery_id, array $args = [] )

Get videos from gallery.

Returns: Array of WP_Post objects

Sync Functions

Sync Metadata

php
vimeify_sync_metadata( bool $fresh = false )

Sync video metadata from Vimeo.

Sync Status

php
vimeify_sync_status( bool $fresh = false )

Check for deleted videos.

Upload Functions

Upload Video

php
vimeify_upload_video( string $file_path, array $args = [] )

Upload video to Vimeo.

Returns: Array with success status and data

REST API Endpoints

Authentication

All endpoints require WordPress authentication.

List Videos

Endpoint: GET /wp-json/vimeify/v1/videos

Parameters:

  • per_page - Videos per page (default: 10)
  • page - Page number (default: 1)
  • category - Filter by category slug
  • search - Search term

Response:

json
{
  "videos": [
    {
      "id": 123,
      "title": "My Video",
      "vimeo_id": "987654321",
      "duration": 120,
      "embed_url": "https://...",
      "thumbnail": "https://..."
    }
  ],
  "total": 50,
  "pages": 5
}

Get Single Video

Endpoint: GET /wp-json/vimeify/v1/videos/{id}

Returns detailed video information.

List Folders

Endpoint: GET /wp-json/vimeify/v1/folders

Returns Vimeo folders.

List Galleries

Endpoint: GET /wp-json/vimeify/v1/galleries

Returns all galleries.

Constants

Post Types

php
VIMEIFY_VIDEO_POST_TYPE = 'vimeify-video'
VIMEIFY_PROFILE_POST_TYPE = 'vimeify-profile'
VIMEIFY_GALLERY_POST_TYPE = 'vimeify-gallery'

Taxonomies

php
VIMEIFY_CATEGORY_TAXONOMY = 'vimeify-category'
VIMEIFY_GALLERY_TAXONOMY = 'vimeify-gallery'

Meta Keys

php
VIMEIFY_VIMEO_ID_META = '_vimeify_vimeo_id'
VIMEIFY_DURATION_META = '_vimeify_duration'
VIMEIFY_PRIVACY_META = '_vimeify_privacy'

Released under the GPL-2.0 License.