Download the PHP package yongfook/bannerbear without Composer
On this page you can find all versions of the php package yongfook/bannerbear. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yongfook/bannerbear
More information about yongfook/bannerbear
Files in yongfook/bannerbear
Package bannerbear
Short Description A PHP Wrapper for the Bannerbear API - A image and video generation service
License MIT
Informations about the package bannerbear
Bannerbear PHP Library
A PHP wrapper for the Bannerbear API - an image and video generation service.
Documentation
Find the full API documentation here
Requirements
PHP 7.4 or Higher
Installation
Install the package with:
To use the bindings, load it via Autoload
Usage
Table of Contents
- Authentication
- Account Info
- Images
- Videos
- Collections
- Animated Gifs
- Movies
- Screenshots
- Templates
- Template Sets
- Video Templates
- Signed URLs
Please note that all methods return dictionaries/associative arrays. Responses can be found in the developer documentation here.
Authentication
Get the API key for your project in Bannerbear and then instantiate a new client.
Alternatively, set the API key in an environment variable named BANNERBEAR_API_KEY
.
Account Info
Return info about the account or project associated with the API key.
Images
Create an Image
To create an image you reference a template uid and a list of modifications. The default is async generation meaning the API will respond with a pending
status and you can use get_image
to retrieve the final image.
You can also create images synchronously - this will take longer to respond but the image will be delivered in the response:
Options
modifications
: an array of modifications you would like to make (array
)webhook_url
: a webhook url to post the final image object to (string
)transparent
: render image with a transparent background (boolean
)synchronous
: generate the image synchronously (boolean
)render_pdf
: render a PDF in addition to an image (boolean
)metadata
: include any metadata to reference at a later point (string
)
Get an Image
List all images
Optionally you can provide a page and limit
Videos
Create a Video
Options
input_media_url
: a url to a publicly available video file you want to import (string)modifications
: an array of modifications you would like to make to the video overlay (array)webhook_url
: a webhook url to post the final video object to (string)blur
: blur the imported video from 1-10 (integer)trim_to_length_in_seconds
: trim the video to a specific length (integer)create_gif_preview
: create a short preview gif (boolean)metadata
: include any metadata to reference at a later point (string)
If your video is using the "Multi Overlay" build pack then you can pass in a set of frames to render via:
frames
: an array of sets of modifications (array)frame_durations
: specify the duration of each frame (array)
Get a video
Update a Video
Options
approved
: approve the video for rendering (boolean)transcription
: an array of strings to represent the new transcription (will overwrite the existing one) (array)
List all Videos
Options
page
: pagination (integer
)
Collections
Create multiple images in one API request.
Options for create_collection
modifications
: an array of modifications you would like to make (array
)webhook_url
: a webhook url to post the final collection object to (string
)transparent
: render image with a transparent background (boolean
)synchronous
: generate the images synchronously (boolean
)metadata
: include any metadata to reference at a later point (string
)
Animated Gifs
Create a slideshow style gif
Options for create_animated_gif
frames
: an array of arrays of modifications you would like to make (array
)frame_durations
: an array of times (in seconds) to show each frame (array
)input_media_url
: optionally import an external video file to use as part of the giffps
: frames per second e.g. 1 (integer
)loop
: whether to loop or not (boolean
)webhook_url
: a webhook url to post the final gif object to (string
)metadata
: include any metadata to reference at a later point (string
)
Movies
Assemble video clips or still images into a single movie with transitions.
Options for create_movie
width
: the movie width in pixels (integer
)height
: the movie height in pixels (integer
)transition
: the transition style: fade, pixelize, slidedown, slideright, slideup, slideleft (string
)inputs
: a list of inputs (array
)webhook_url
: a webhook url to post the final movie object to (string
)metadata
: include any metadata to reference at a later point (string
)
Screenshots
Take screenshots of websites.
Options for create_screenshot
width
: the desired screenshot width in pixels (integer
)height
: the desired screenshot height in pixels (integer
)synchronous
: generate the screenshot synchronously (boolean
)mobile
: use a mobile user agentwebhook_url
: a webhook url to post the final screenshot object to (string
)
Templates
Template Sets
Video Templates
Signed URLs
This gem also includes a convenient utility for generating signed urls. Authenticate as above, then:
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/yongfook/bannerbear-php. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Bannerbear project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
All versions of bannerbear with dependencies
ext-curl Version *