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.
Changelog
All notable changes to this project will be documented in this file.
[1.1.4]
Changed
-
SDK version bump:
1.1.3→1.1.4. A maintenance release that updates the SDK’s internal version identifiers. It contains no functional, API, or behavioral changes and is fully backward compatible with1.1.3.Updated identifiers:
SDKVersionconstant — now reports1.1.4.User-Agentheader — outbound requests now identify asfastpix-sdk/go 1.1.4.
Compatibility
- No changes to public types, method signatures, request/response models, default server URLs, hooks, or retry logic.
- No action required for existing integrations — update the dependency and rebuild.
[1.1.3]
Changed — FastPix .io → .com migration
FastPix is moving its hosts and documentation to the .com TLD. This release updates every reference in the SDK and its docs:
- The default server URL is now
https://api.fastpix.com/v1/(washttps://api.fastpix.io/v1/). If you rely on SDK defaults, no code change is required — upgrading and rebuilding is enough. - If you pass an explicit override (e.g.
fastpixgo.New(fastpixgo.WithServerURL("https://api.fastpix.io/v1/"))), change it tohttps://api.fastpix.com/v1/. - All README and per-service documentation links now point at
https://fastpix.com/docs/....
The .io hosts still serve traffic during the transition but are slated for deprecation — update any hard-coded .io references (server URL, playback/asset URLs) in your application.
Fixed
- Added missing
frameRatefield to video tracks in the list media response (VideoTrackForGetAll). - Added missing
data.messagefield to the delete signing key response (DeleteSigningKeyResponse).
[1.1.2]
Fixed
- Fixed data event field remapping in hooks.
[1.1.1]
- Replaced documentation placeholders from
your-video-idtoyour-media-id.
[1.1.0]
Fixed
- Fixed missing parameters in multiple API methods.
Improved
- Improved overall developer experience through more accurate typings.
[1.0.0]
Added
- Complete API coverage for Media, Live Streaming, Video Data, and Signing Keys
- Go 1.22+ support with comprehensive type safety
- Media upload, management, and processing capabilities
- Live streaming with simulcasting support
- Video analytics and performance tracking
- Cryptographic signing keys for secure authentication
- In-video AI processing features
- DRM configuration and management
- Playlist creation and management
- Comprehensive error handling with specific error types
- Built-in retry mechanisms and timeout handling
- Comprehensive test suite with 14 test files
- Full API specification compliance
Changed
- Reorganized package structure for better maintainability
- Updated dependencies to modern Go packages
- Improved API design with better error handling
- Enhanced documentation and examples
- Updated SDK version to 1.0.0
- Updated minimum Go version requirement to 1.22+ for better compatibility and performance
Fixed
- Direct upload metadata handling
- Response object access patterns
- Type mismatches in method parameters
- Error handling for validation responses
- Test data structure alignment with API expectations
- Improved error handling with specific error types
- Fixed type annotation issues for better IDE support
- Ensured consistent API patterns across modules
[0.0.1]
Added
- Initial release of FastPix Go SDK
- HTTP client support with Go standard library
- Media API integration with upload, management, and processing
- Playback ID management for media files
- Media operations (list, get, update, delete)
- Direct upload support for video files
- Live stream API integration
- Live stream management (create, update, delete)
- Playback ID management for live streams
- Simulcast configuration for live streams
- HTTP Basic authentication support
- Server URL override support
- Comprehensive error handling and custom error classes
- Example usage and quick start documentation
- Go Modules integration
- Type checking integration
- Test framework integration