Go SDK
Add secure, scalable video to your Go project
The FastPix Go SDK gives you everything you need to manage video from your backend. Upload files from a public URL, attach metadata, and retrieve playback links, all without building encoding pipelines or managing storage. With this SDK, you can:
- Upload and organize video assets
- Define access control and metadata
- Generate HLS playback URLs
- Streamline video delivery from your Go server
Find more in the SDK reference
To explore more examples, API methods, and advanced usage, see the FastPix Go SDK on GitHub.
Prerequisites
Before you start using the FastPix Golang SDK, make sure you have the following:
- Go 1.20 or later: This SDK is compatible with Go 1.20 or higher
- Go modules enabled: Ensure your project uses Go modules for dependency management
- FastPix API credentials: You’ll need an Access Key and a Secret Key (HTTP Basic Auth). You can generate these credentials by following the steps in the Authentication guide.
- Basic understanding of Go and REST APIs: Familiarity with Go development and API integration concepts
Installation
Install the SDK using go get:
Import the SDK
Example
Let’s create a file named main.go
This example shows how to upload a video from a public URL with metadata and public access:
NOTE
In the following example, replaceyour-access-token-idandyour-secret-keywith the Access Token ID and Secret Key values from the.envfile you downloaded.
After the video is processed, you can use the media ID to fetch playback info, monitor status, or transform content via API.
Run the example
To execute the Go script, use the following command. Make sure to replace main.go with your actual file name if it’s different:
NOTE
Some methods might throw errors when you are on a trial plan.