LPR Camera API for Entry Gate License Plate Automation

Home › Forums › Viewtron Security Camera Systems Support › IP Camera API › LPR Camera API for Entry Gate License Plate Automation

  • Here are some questions I recently answered for an integrator about using the Viewtron LPR-IP4 in a project to automate a vehicle gate based on license plate recognition.

    1. Direct event POST without an NVR. Can the LPR-IP4 POST its ANPR/plate-read events (license plate text, confidence, capture timestamp, and a snapshot image or image URL) directly to an external HTTPS endpoint via HTTP POST / webhook — with NO NVR or VMS required in the path? If yes, what is the exact payload format (XML or JSON) and can I configure the destination URL and headers in the camera’s web UI?

    Yes. The Viewtron LPR-IP4 can send an HTTP Post to an endpoint URL that you specify. It can do this with or without using a Viewtron NVR. You can find the HTTP Post and LPR detection setup instructions here. https://videos.cctvcamerapros.com/v/lpr-camera-api.html

    The payload that the Post sends is XML. You can see the raw XML payload as well as Python and Node SDK examples here.
    https://videos.cctvcamerapros.com/developer/docs/applications/license-plate-recognition-camera-api

    2. If an NVR IS required? If the camera cannot send the events standalone and needs an NVR (or VMS) to forward ANPR events, please confirm that, and tell me which NVR model is required and whether that NVR can forward plate events to an external HTTPS endpoint.

    The NVR is not required, but for most customers, a Viewtron NVR makes managing the LPR camera easier because the NVR’s UI is fully integrated with setting up and managing all license plate recognition functions. For a developer that wants to use the API, you do not need the NVR unless you want to use it as your storage for recordings. But again, the user interface of the NVR make it very easy to manage your license plate database and to setup the license plate detection and recognition functions.

    3. Payload contents. For each plate read, does the event include: plate number, confidence score, direction or lane ID, timestamp, and an image (attached or as a URL)? A sample event payload would be extremely helpful.

    Yes. Each plate read includes the license plate number, a confidence score, the direction of travel, a timestamp, the full overview image, and a cropped image of the license plate. On current LPR-IP4 firmware (5.3.x), the post also tells you if the plate is on the camera’s allow list, block list, or temporary list. It also includes vehicle attributes: color, type, brand, and model. There is no lane ID field. Every post does include the camera’s device name, serial number, MAC address, and channel ID, so your backend can tell which camera (and lane) sent it.

    Here is a short snippet from a real plate read from an LPR-IP4 running firmware 5.3.x, with the base64 images removed:

    <plateNumber type="string"><![CDATA[IB36NL]]></plateNumber>
    <vehicleDirect type="vehicleDirectType">approach</vehicleDirect>
    <vehicleListType type="vehileMatchAlarmList">whiteList</vehicleListType>
    <PlateConfidence type="uint32" count="9900"/>
    <carAttr>
      <color type="vsdCarAttrColorType">grey</color>
      <type type="vsdCarAttrTypeType">saloon car</type>
      <brand type="vsdCarAttrBrandType">Tesla</brand>
      <model type="vsdCarAttrModelType">Tesla_ModelS</model>
    </carAttr>
    • PlateConfidence: the score is in the count attribute on a 0 to 10000 scale, so count="9900" is 99%.
    • vehicleDirect: the direction of travel. This car was driving toward the camera (approach). A car driving away reports away.
    • vehicleListType: whiteList (allow list), blackList (block list), or temporaryList when the plate is in the camera’s vehicle database.

    For a gate, these two fields are handy. Your backend can open the gate only for vehicles coming toward the camera, and only above a confidence you choose (for example 90%). That keeps cars that are leaving from opening the gate. The camera can also be set to read plates only on approach (Recognition Mode in the license plate detection settings).

    The fields and values can change between firmware versions, so check a real post from your own camera before you finalize your parser. You can find the full field list in our event format doc: https://videos.cctvcamerapros.com/developer/docs/api-reference/events/ipc-event-format/

    You can find the complete LPR camera API guide here: https://videos.cctvcamerapros.com/developer/docs/applications/license-plate-recognition-camera-api

    Note: we first wrote that the post had no confidence score and no direction. That was wrong, and we have corrected it above.

    Update, October 8, 2026: The snippet above is from a real drive-by test with a Viewtron LPR-IP4 camera running firmware 5.3.1. The test plate IB36NL was on the camera’s allow list, and the camera read it once, at 99% confidence, with the direction approach and the list status whiteList. VEHICE and vehileMatchAlarmList are spelled exactly the way the camera sends them.

    Here is a simple gate rule based on this post:

    • Read the second listInfo item (item 1, counting from 0). That is where the plate number, direction, list status, and confidence are. Item 0 is the overview image.
    • Open only when vehicleDirect is approach (coming toward the camera). The other value is away (driving away from the camera).
    • Open only when vehicleListType is whiteList. If the plate is not on any list, the camera leaves vehicleListType out of the post completely, so a missing element should mean “do not open”.
    • Open only when the confidence is high enough. A 90% threshold means a PlateConfidence count of 9000 or higher.
    • currentTime is Unix time in microseconds, so divide it by 1,000,000 before you compare it with your server clock.

    The post gives you the list name only. It does not include a group number. If you also use the temporary list for visitors, check a real post for a temporary plate from your own camera before you add that value to your gate rule.

    4. Software-triggered gate/door output. Can the camera (or its API) trigger a relay / dry-contact output, or accept an API command, to open a gate or door based on a software decision from my backend? If so, is that an on-camera relay or does it require additional hardware?

    Yes. The Viewtron LPR-IP4 has a built-in dry contact relay. The relay can be triggered based on the built-in automatic license plate recognition / license plate database. You can also manually trigger the relay output via an API call from your software. Please note that Viewtron NVRs also have a dry contact alarm relay panel on the back of them. The LPR camera can trigger any of the NVR’s relay output ports when an authorized license plate is recognized.

    5. Network requirements. Does the camera need any inbound ports open, or does it only make outbound HTTPS connections? (Outbound-only is strongly preferred for my deployment.)

    There is no internet connection or reliance on a cloud service. All of the license plate detection and automatic license plate recognition inference software runs locally on the LPR camera itself. So only outbound HTTP Post / webhook calls are required for a software integration like you are designing.

    6. Current pricing and lead time for 2x LPR-IP4, plus any required NVR or accessories based on your answers above.

    Current pricing for the LPR-IP4 is $699.99 each. You can find the Viewtron LPR camera on this page.
    https://www.cctvcamerapros.com/LPR-Camera-p/lpr-ip4.htm

    The only accessories you need are a PoE switch or PoE injectors, and network cable. These PoE injectors work.
    https://www.cctvcamerapros.com/POE-Injector-Kit-p/poe-12v48.htm

    This PoE switch works.
    https://www.cctvcamerapros.com/IP-Camera-PoE-Switch-p/poe-sw54.htm

    And, as I mentioned, it is not required but I do highly recommend using a Viewtron IP camera NVR with the LPR camera because it makes it much easier to setup and manage. You can find all of our Viewtron NVRs on this page. All of them are integrated with the Viewtron LPR functions and all other AI security camera functions.
    https://www.cctvcamerapros.com/IP-Camera-NVRs-s/1472.htm

    One last thing that you should consider. Viewtron LPR cameras are highly specialized are excellent at detecting license plates and automatically recognizing the plate numbers / letters. However, they are not designed to record the best overview of the vehicle and surrounding area. They are focused in on the plate detection zone. So, I almost always recommend using at least one “overview camera” with each LPR camera. You can see that we include a Viewtron AI camera (human detection / vehicle detection) with our license plate recognition systems.

    Here are some of the most popular Viewtron AI cameras that we use when designing an LPR system for customers.
    https://www.cctvcamerapros.com/4mp-IP-bullet-camera-p/ip-a4bz.htm
    https://www.cctvcamerapros.com/4K-IP-Camera-p/ip-a8bz.htm

    7. Electrical relay output trigger call. The exact endpoint + request payload our backend sends to fire the camera’s dry-contact relay (software-decided gate open). I believe this is in the “Relay & IoT Control” API reference — a sample request/response would be ideal.

    You can find that here: https://videos.cctvcamerapros.com/developer/docs/api-reference/alarm/alarm-input-output-config/

    8. AddLicensePlates call. The exact request format to push a plate onto the camera’s on-board whitelist, including the owner-info and date-range fields. Also the matching Modify and Delete plate calls, since we’ll be managing the list (add/update/remove) as monthly permits change.

    You can find the complete LPR camera API reference here: https://videos.cctvcamerapros.com/developer/docs/applications/license-plate-recognition-camera-api

    In the camera’s web interface, a plate in the vehicle database can be given a start and end time and owner details (for example, for a temporary vehicle), and we will add the API details for those fields to the LPR camera API guide.

    One thing to know when you manage the list from your software: on 5.3.1 firmware, the camera’s plate groups are numbered 1 = temporaryList, 2 = whiteList (allow list), and 3 = blackList (block list). Group 1 is the temporary list, so monthly permit holders who should open the gate belong in group 2. The HTTP Post shows the list name (for example whiteList), never the group number.

    9. Plate-event image. Does the standalone IPC’s plate-event POST include the cropped-plate image (targetBase64Data) by default, or does that need to be enabled in config? Rough size is helpful too.

    You can enable full size image snapshot and / or the cropped license plate image to be included in the HTTP Post setup. You can see the setup instructions here.

    LPR Camera API for Software Development Integration and Apps

    10. smartType value on current firmware. Our parser matches the “VEHICE” value for IP camera events — can you confirm that’s what your current shipping firmware sends (vs. “vehicle” or a corrected spelling)? Just want to match what the units actually emit.

    Some older firmware builds send VEHICLE (with an L) instead of VEHICE, so we recommend matching both. If you go through the NVR, it will be the 2.0 API which uses “vehicle”.
    https://videos.cctvcamerapros.com/developer/docs/applications/license-plate-recognition-camera-api

    Update, October 2026: we checked this on a Viewtron LPR-IP4 camera running firmware 5.3.1. All 194 posts we captured from it used the original V1 XML layout, with config version 1.7, smartType VEHICE, and no messageType element. So VEHICE is what current firmware sends straight from the camera. We still recommend matching VEHICLE too, for older builds.

    11. Auth on the relay/whitelist API calls. Do those calls require the camera’s username/password (digest auth?), a token, or are they open on the local network?

    You can use basic auth for the API authentication.
    https://videos.cctvcamerapros.com/developer/docs/getting-started/authentication

    LPR Camera Videos

    You can watch many video demos using our Viewtron LPR cameras here.

    If you have any questions about using the Viewtron LPR camera API / SDK or need help with a complete security camera system design, please email me at mike@viewtron.com.