WebHooks are a great way to integrate OpenALPR data with other systems such as external databases, parking systems, etc.  Every time OpenALPR receives a plate or triggers an alert, the system can forward you the data in JSON format. You'll need an internet accessible endpoint for OpenALPR to send the data. If your application will not have access to the internet, you can pull from the local beanstalk queue as an alternative (see our documentation for details).

One quick way to get started is to use a free endpoint on www.beeceptor.com.  This will show you the JSON data as it is received. Copy the JSON locally, and use it to develop code that implements your desired logic for handling the results. The JSON formats for the Alert results and Plate results are shown at the bottom of this article.

Once you've tested your solution, you can switch OpenALPR to your own endpoint. This Github gist is a useful starting point that provides a working HTTP server using only built-in Python3 modules. For production use, we recommend upgrading the backend to a more fully-featured web framework such as Django or Flask.

Alert Results

{
   "camera_name" : "yourcameraname",
   "plate_number" : "ABC123",
   "description" : "Test",
   "site_name" : "yoursitename",
   "data_type" : "alpr_alert",
   "alert_list" : "youralertlistname",
   "list_type" : "Blacklist",
   "camera_number" : 1000,
   "epoch_time" : 1548715870757,
   "version" : 1,
   "agent_uid" : "TESTTESTTESTTESTTESTTESTTESTTESTTESTTEST",
   "group" : {
      "best_plate" : {
         "processing_time_ms" : 252.10795593262,
         "plate" : "ABC123",
         "region_confidence" : 99,
         "region" : "us-ca",
         "candidates" : [
            {
               "confidence" : 94.969917297363,
               "matches_template" : 1,
               "plate" : "ABC123"
            },
            {
               "plate" : "ZBC123",
               "confidence" : 75.969917297363,
               "matches_template" : 1
            }
         ],
         "plate_index" : 0,
         "confidence" : 94.969917297363,
         "matches_template" : 1,
         "vehicle_region" : {
            "height" : 796,
            "width" : 796,
            "y" : 101,
            "x" : 465
         },
         "requested_topn" : 10,
         "coordinates" : [
            {
               "x" : 783,
               "y" : 594
            },
            {
               "y" : 590,
               "x" : 944
            },
            {
               "x" : 942,
               "y" : 670
            },
            {
               "x" : 781,
               "y" : 674
            }
         ]
      },
      "travel_direction" : 272.82250976562,
      "frame_start" : 686,
      "agent_type" : "alprd",
      "plate_indexes" : [
         1,
         1,
         1,
         0,
         0,
         0,
         0,
         0
      ],
      "is_parked" : false,
      "best_plate_number" : "ABC123",
      "candidates" : [
         {
            "plate" : "ABC123",
            "matches_template" : 1,
            "confidence" : 94.969917297363
         },
         {
            "plate" : "ZBC123",
            "matches_template" : 0,
            "confidence" : 73.047538757324
         }
      ],
      "agent_version" : "2.5.101",
      "data_type" : "alpr_group",
      "agent_uid" : "TESTTESTTESTTESTTESTTESTTESTTESTTESTTEST",
      "vehicle" : {
         "body_type" : [
            {
               "confidence" : 77.165916442871,
               "name" : "suv-standard"
            },
            {
               "name" : "suv-crossover",
               "confidence" : 22.672147750854
            },
            {
               "name" : "sedan-compact",
               "confidence" : 0.096009664237499
            }
         ],
         "color" : [
            {
               "confidence" : 79.536285400391,
               "name" : "gray"
            },
            {
               "confidence" : 15.457083702087,
               "name" : "silver"
            },
            {
               "name" : "blue",
               "confidence" : 4.4487705230713
            }
         ],
         "make_model" : [
            {
               "confidence" : 36.614269256592,
               "name" : "jeep_grand-cherokee"
            },
            {
               "name" : "jeep_cherokee",
               "confidence" : 16.472534179688
            },
            {
               "confidence" : 16.10675239563,
               "name" : "hyundai_santa-fe"
            }         ],
         "make" : [
            {
               "name" : "jeep",
               "confidence" : 74.869903564453
            },
            {
               "confidence" : 17.465110778809,
               "name" : "hyundai"
            }
         ]
      },
      "uuids" : [
         "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-1085180796-1515530858898",
         "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-1085180796-1515530858792",
         "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-1085180796-1515530858968",
         "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-1085180796-1515530859222",
         "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-1085180796-1515530859363",
         "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-1085180796-1515530859504",
         "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-1085180796-1515530859469",
         "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-1085180796-1515530859572"
      ],
      "country" : "us",
      "epoch_start" : 1548715870757,
      "best_confidence" : 94.969917297363,
      "camera_id" : 1000,
      "best_uuid" : "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-1085180796-1515530859222",
      "frame_end" : 708,
      "epoch_end" : 1548715873757,
      "user_data" : "hello world",
      "company_id" : "xxxxxxxx-xxxx-yyyy-yyyy-zzzzzzzzzzzz",
      "best_region" : "us-ca",
      "version" : 2,
      "best_region_confidence" : 99,
      "best_image_width" : 1920,
      "best_image_height" : 1080
   }
}

Group Results:

{
   "agent_version" : "2.6.103",
   "agent_uid" : "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ",
   "frame_end" : 5327065,
   "plate_indexes" : [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
   ],
   "vehicle_crop_jpeg" : "[base64_data]",
   "best_plate_number" : "HXM4249",
   "best_confidence" : 94.6457672119141,
   "uuids" : [
      "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-399580019-1548711954705",
      "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-399580019-1548711955004",
      "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-399580019-1548711955096",
      "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-399580019-1548711955271",
      "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-399580019-1548711955478",
      "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-399580019-1548711955606",
      "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-399580019-1548711955813",
      "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-399580019-1548711955905"
   ],
   "epoch_start" : 1548711954705,
   "web_server_config" : {
      "agent_label" : "youragentlabel",
      "camera_label" : "unnamed"
   },
   "best_image_height" : 1080,
   "best_region" : "us-pa",
   "agent_type" : "alprd",
   "best_region_confidence" : 99,
   "data_type" : "alpr_group",
   "best_uuid" : "XXXXXXXXXXXXYYYYYYYYYYYYYZZZZZZZZZZZZZZZ-399580019-1548711955004",
   "company_id" : "xxxxxxxx-xxxx-yyyy-yyyy-zzzzzzzzzzzz",
   "frame_start" : 5327053,
   "epoch_end" : 1548711955905,
   "country" : "us",
   "travel_direction" : 5.8846435546875,
   "candidates" : [
      {
         "plate" : "HXM4249",
         "confidence" : 94.6457672119141,
         "matches_template" : 0
      },
      {
         "confidence" : 80.710075378418,
         "matches_template" : 0,
         "plate" : "XM4249"
      },
      {
         "plate" : "BXM4249",
         "confidence" : 79.5550155639648,
         "matches_template" : 0
      },
      {
         "plate" : "MXM4249",
         "matches_template" : 0,
         "confidence" : 74.270866394043
      },
      {
         "plate" : "HXM429",
         "matches_template" : 0,
         "confidence" : 72.225227355957
      }
   ],
   "best_image_width" : 1920,
   "is_parked" : false,
   "version" : 2,
   "camera_id" : 399580019,
   "best_plate" : {
      "region" : "us-pa",
      "region_confidence" : 99,
      "processing_time_ms" : 82.7420043945312,
      "candidates" : [
         {
            "matches_template" : 0,
            "confidence" : 94.6457672119141,
            "plate" : "HXM4249"
         },
         {
            "confidence" : 81.219482421875,
            "matches_template" : 0,
            "plate" : "XM4249"
         },
         {
            "plate" : "BXM4249",
            "matches_template" : 0,
            "confidence" : 81.0806350708008
         }
      ],
      "requested_topn" : 10,
      "plate" : "HXM4249",
      "plate_crop_jpeg" : "[base64_data]",
      "vehicle_region" : {
         "height" : 665,
         "x" : 761,
         "y" : 198,
         "width" : 665
      },
      "coordinates" : [
         {
            "x" : 1031,
            "y" : 607
         },
         {
            "x" : 1158,
            "y" : 608
         },
         {
            "y" : 674,
            "x" : 1158
         },
         {
            "x" : 1031,
            "y" : 673
         }
      ],
      "plate_index" : 0,
      "confidence" : 94.6457672119141,
      "matches_template" : 0
   },
   "matches_template" : false,
   "vehicle" : {
      "body_type" : [
         {
            "name" : "suv-crossover",
            "confidence" : 71.0338439941406
         },
         {
            "confidence" : 16.2392520904541,
            "name" : "sedan-standard"
         },
         {
            "name" : "sedan-wagon",
            "confidence" : 5.262282371521
         },
         {
            "name" : "van-mini",
            "confidence" : 3.85403752326965
         }
      ],
      "make" : [
         {
            "confidence" : 99.8798980712891,
            "name" : "audi"
         },
         {
            "confidence" : 0.0299057718366385,
            "name" : "volkswagen"
         }
      ],
      "color" : [
         {
            "name" : "silver-gray",
            "confidence" : 97.7629928588867
         },
         {
            "confidence" : 1.64892303943634,
            "name" : "white"
         }
      ],
      "make_model" : [
         {
            "confidence" : 88.2079544067383,
            "name" : "audi_a4"
         },
         {
            "name" : "audi_q3",
            "confidence" : 2.30620789527893
         },
         {
            "confidence" : 1.82921254634857,
            "name" : "audi_q5"
         }
      ],
      "year" : [
         {
            "confidence" : 51.4213447570801,
            "name" : "2015-2019"
         },
         {
            "name" : "2010-2014",
            "confidence" : 47.7990036010742
         },
         {
            "name" : "2005-2009",
            "confidence" : 0.759456098079681
         }
      ],
      "orientation" : [
         {
            "name" : "180",
            "confidence" : 99.1021575927734
         },
         {
            "name" : "225",
            "confidence" : 0.487651824951172
         }
      ]
   }
}