How do I get Hikvision ANPR plate data via the HTTP API?
Answered by ANPR AI·Sourced
Short answer
Many integrators discover that recent Hikvision firmware has deprecated traditional GET polling endpoints for plate data. Instead of polling the camera, you must configure the camera's HTTP Listening Server to actively push multipart XML payloads to a designated TCP server whenever a plate is detected.
Explanation
Historically, developers would pull license plate events by running scripts that repeatedly queried endpoints like /ISAPI/Traffic/channels/1/vehicleDetect/plates. However, as Hikvision transitions toward more robust architectures, these polling endpoints frequently return HTTP 404 errors on newer firmware (like V5.x on the iDS series). This shift requires a change in architecture from a "polling" model (where the software asks the camera for data) to a "listening" model (where the software waits for the camera to push data).
To successfully extract data, you must establish a TCP server listener on your network. When a vehicle passes, the Hikvision camera generates a multipart payload containing XML plate text, country metadata, and image byte arrays, pushing it to your listener. It is critical that your custom server immediately replies with an HTTP 200 OK header; if it fails to do so, the camera's Automatic Network Replenishment (ANR) function assumes the server is offline and will repeatedly retry sending the same event, clogging the network.
Things to check
- Confirm you are not relying on deprecated GET polling endpoints that may have been disabled in recent firmware updates.
- Ensure your custom TCP listening server is actively returning the HTTP/1.1 200 OK header upon receipt of the payload.
- Verify you have correctly configured the "Server Alarm" IP and Port in the camera's Advanced Network Settings.
What to do
Configure a basic TCP server listener on your desired port. Log into the Hikvision camera, navigate to Advanced Network Settings > Alarm Server, and input your TCP server's IP address and port. Once the vehicle passes, parse the incoming multipart XML data and save the byte arrays as JPEG images.
Alternatively, if you must poll for historical records, use Postman with Digest Authentication aimed at the newer /ISAPI/Traffic/vehicleInfoCond endpoint, inserting a properly formatted XML body into a POST request to retrieve the data.
ANPR Edge
Skip the dedicated ANPR camera. Read plates from the cameras you already have.
ANPR Edge is plate-recognition software that runs on a PC at your site and works with ordinary IP cameras, so plate reads no longer depend on one vendor's camera, NVR or firmware.
- Works with standard IP cameras over RTSP
- One license per location covers every camera
- Runs on a Windows PC or Mac you own