VAPIX is Axis’ own open API (Application Programming Interface) for their camera and security products that enables the integration into a wide range of platforms and solutions.
In this guide, we will explain how VAPIX works and demonstrate its functionality with various useful examples. Once you grasp this protocol, you can use the official Axis VAPIX library to write your own code and pull out various information from your cameras.
What is VAPIX and how does it work
VAPIX is an open API developed and maintained by Axis Communications that facilitates and integrates the communication between different devices and platforms.
VAPIX provides integration and functionality requesting video streams, images, controlling recordings, controlling Pan Tilt Zoom, controlling input/output ports, retrieving and controlling internal settings, managing events, managing motion settings, recording and retrieving video to/from the SD card, and much more. Almost all the functionality available in Axis products can be controlled using VAPIX.
In short, using VAPIX you can:
- Request video stream from the camera
- Manage the recordings
- Retrieve recordings from SD cards or recorders
- Control PTZ cameras
- Manage events, motions settings, and other triggers
- Retrieve still images from the cameras
- Adjusts various settings on the camera
List of VAPIX API
There are three methods how developers can use Axis’s API hooks:
- HTTP/HTTPS POST JSON
- HTTP/HTTPS GET/POST
- SOAP
Most Axis users use the HTTP/HTTPS GET/POST method. All the Axis API hooks can be accessed via the Axis VAPIX library, which is hosted on Axis’s official website. To access the library, you need to create an account on Axis’ website and then log into the page.
Go to the Axis website and click the Login button on the top right side, then click the Register New Account option. Follow the prompts and enter your information.
Once you have created the account and verified your email address, visit the Axis VAPIX library and log in using your credentials (username, password).
There, you should see all the hooks and variables that you can use to write your own code and pull out information from the camera system.
Examples of Axis VAPIX
Let’s pretend the camera’s IP address is 192.168.1.200. We will use the HTTP command (not HTTPS). Here’s how you can pull various information from the camera.
General Parameters
This command lists the camera parameters.
http://192.168.1.200/axis-cgi/param.cgi?action=list
This one lists the camera I/O parameters (input/output).
http://192.168.1.200/axis-cgi/param.cgi?action=list&group=IOPort.I0
PTZ VAPIX Commands
Calls a preset in the camera and aims the camera to a specific position. In this case, the position is labeled “Start”. You have to replace the label with the one you’ve set up.
http://192.168.1.200/axis-cgi/com/ptz.cgi?gotoserverpresetname=Start
This one lists the available presets in the camera.
http://192.168.1.200/axis-cgi/com/ptz.cgi?query=presetposall
Similar to the first one, this command will bring the camera to a specific position, but this time the label is a number (NOT name)
http://192.168.1.200/axis-cgi/com/ptz.cgi?gotoserverpresetno=5
By deploying this command, the camera will return to the start/home position when the inactive time is 30 seconds. You can set your own time.
http://192.168.1.200/axis-cgi/param.cgi?action=update&PTZ.Various.V1.ReturnToOverview=30
This command turns on the camera wipers (on models that use a wiper on the lens).
http://192.168.1.200/axis-cgi/com/ptz.cgi?auxiliary=tt:Wiper|On
If you want to disable the wiper, use the command below.
http://192.168.1.200/axis-cgi/com/ptz.cgi?auxiliary=tt:Wiper|Off
This command starts the PTZ Guard Tour
http://192.168.1.200/axis-cgi/param.cgi?action=update&GuardTour.G0.Running=yes
Other useful VAPIX commands
VAPIX command to play audio clips (on the cameras that come with speakers).
http://192.168.1.200/axis-cgi/playclip.cgi?clip=Trespassing
Create a user and a password as part of the “Users” group. This account has view privileges.
http://192.168.1.200/axis-cgi/pwdgrp.cgi?action=add&user=user1&pwd=myPass&grp=users&sgrp=viewer&comment=NewUser
Start the Video Motion Detection
http://192.168.1.200/axis-cgi/applications/control.cgi?action=start&package=vmd
This command stops the Video Motion Detection.
http://192.168.1.200/axis-cgi/applications/control.cgi?action=stop&package=vmd
You can even use VAPIX commands to troubleshoot issues. For example, you can use the ing command to test the communication on the network. If successful, you should see the “got response” text. If not, it will fail.
http://192.168.1.200/axis-cgi/pingtest.cgi?ip=192.168.1.1
This command tests and creates a server report from the camera.
http://192.168.1.200/axis-cgi/admin/serverreport.cgi
VAPIX basic commands explained
Let’s say we want to pull out the camera’s resolution information. First, you need to log into the Axis camera via the web browser and use the administrator privileges (root). Then you can type this command on the URL bar (the camera’s IP address is 192.168.1.200):
http://192.168.1.200/axis-cgi/imagesize.cgi?camera=1
As you can see, the query will show the resolution information on the screen (image width and weight). The command query is explained below
Protocol: HTTP. If you’re using a security certificate you can utilize HTTPS
IP address: this is the IP address of the camera (that you’re logged into).
Path: This is the camera’s path
Application: the command on the camera
Argument and value: this part is the argument (which is the camera) and its value. To get all the arguments and values, you need to check the VAPIX library. It’s quite easy, you just need to consult the VAPIX documentation.
It’s also possible to use the “&” symbol to add or combine multiple arguments and generate a query that fits your needs.
For example, http://192.168.1.200/axis-cgi/param.cgi?action=list&group=Brand
In this case, we have two arguments combined together. One is param.cgi which is a command that pulls out the parameters of the camera and the group=Brand argument filters the results and lists just the brand and other essential parameters.
If you drop the group argument, the camera will list a huge list of (unnecessary) parameters.
Conclusion
VAPIX is a useful and powerful API that allows the user to send commands to the camera and extract information from the camera such as footage, video stream, images and adjust other settings.
Additionally, you can control, manage and update the camera or any other Axis devices.
This guide shows just a few basic commands and queries, if you need to dig deep into VAPIX, you need to consult the official VAPIX library on Axis’ official website. There are endless possibilities that you can utilize to get the best out of your Axis camera system.