Tutorials · 4 min read

Header image for a blog post about creating an Airbnb-like service using api.video

API showcase - build a service like Airbnb with api.video

Building a website like Airbnb? Let api.video enhance your platform with video upload and delivery functionalities. This blog post showcases the API endpoints that you can use to build a simple and robust solution that enables your users to upload and play videos for their customers.

Zoltán

December 27, 2023

This tutorial showcases the API endpoints and operations that you can use to add video functionalities to a service similar to Airbnb. The tutorial only focuses on the API itself - you can use our recent tutorial about creating a video uploader in PHP to learn more about creating the backend and frontend for a similar web-based solution.

Why videos?

When you create a platform where you want to enable users to sell or rent, adding video functionality can be a game changer. In case of a solution that’s similar to Airbnb, showing videos can help hosts earn the trust of their guests, which can lead to more bookings, and increased traffic on your platform.

 

api.video’s API can give you a simple solution to provide these functionalities for your users:

  • creating and uploading a video
  • managing videos: listing, editing, or updating uploaded videos
  • deleting a video

 

Let’s go through these endpoints!

Create and upload a video

Creating and uploading videos is a simple concept in the api.video ecosystem:

 

  1. First, you create a video object. Think of it as a container for the video file. Creating a video object generates the video’s videoID, and amongst other things, creates the assets URLs that you can embed into your website. You can use the metadata attribute to add unique key-value pairs to each video object, for example to differentiate between users who upload the video.

 

  1. Then, you upload a video into that video container object. The uploaded video file is hosted by api.video. Uploading a video file starts the encoding process. Depending on your stream quality, your videos are encoded into HLS in different resolutions, from 240p to 2160p.
Flowchart of the video object creation and file upload for api.video.

Manage videos

Giving your users the ability to manage their videos is straightforward through api.video’s endpoints:

  • list all videos to retrieve and display a list of videos for your users. You can use the metadata attribute you provided to filter specific content for different users.
  • upload or set thumbnails for videos. Setting thumbnails uses content from the video based on a set time interval.
  • update a video to modify attributes like titles, descriptions, whether the video is published or hidden. Check out the API reference for a full list of attributes that you can update.
  • retrieve video status to show real-time information on encoding status, and to determine when a video is uploaded, and ready for playback. Once the encoding is completed, the API response also lists the available stream qualities. You can make your solution more robust by subscribing to the video.encoding.quality.completed webhook. This webhook triggers whenever you upload a video and the API finishes encoding the video in a set quality. Read more about webhooks in the API reference.

Demo

We have put together a simple demo for you to see how the video upload and playback in the “Airbnb” workflow could look like - head over to the Airbnb mockup page to try it out yourself.

What’s next?

Now that you understand the different API functionalities behind creating, uploading, and managing videos, you can also start thinking about video delivery.

 

Check out our Delivery & Analytics quickstart to learn how to implement the api.video Player, and the different ways you can provide play analytics data to your users. Analytics enables you to create useful visualizations and data-driven enhancements for your users in your platform.

 

Read more about Analytics and how it can help content strategy in our recent blog post.

Further reading

Check out the documentation to learn more about:

 

If you prefer a more hands-on approach, try going through the VOD quickstart, where we guide you through the process of creating a sample video implementation in a few easy steps.

 

To start using api.video and see how all this works, sign up for a free sandbox account now.

Try out more than 80 features for free

Access all the features for as long as you need.
No commitment or credit card required

Video API, simplified

Fully customizable API to manage everything video. From encoding to delivery, in minutes.

Built for Speed

The fastest video encoding platform. Serve your users globally with 140+ points of presence. 

Let end-users upload videos

Finally, an API that allows your end-users to upload videos and start live streams in a few clicks.

Affordable

Volume discounts and usage-based pricing to ensure you don’t exceed your budget.