> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sonoransoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lookups

> Implements name and plate lookups via the CAD.

> [!WARNING]
>
> This submodule utilizes API endpoints that require the **plus** version of Sonoran CAD or higher. For more information, view our [pricing ](https://docs.sonoransoftware.com/cad/pricing/faq)page.

> [!WARNING]
>
> This submodule is currently only used as a dependency for other submodules , and **does not have any in-game commands for general player usage**.

> [!TIP]
>
> Looking for FiveM hosting? View our [current hosting offer](https://docs.sonoransoftware.com/promotions/fivem-hosting.md).

This submodule Implements name and plate lookups via the CAD.

## Activation Video

Click to view our [WraithV2 plate reader and lookup installation video](https://youtu.be/IgaISh1CykE).

## Activation Guide

### Download and Install the Core

If you haven't already, be sure to install and configure the [SonoranCAD Core](https://docs.sonoransoftware.com/cad/integration-plugins/in-game-integration/fivem-installation) first.

### Activate the Submodule and all Dependencies

Lookups is included and enabled automatically for the plugins that need it. It is hidden from the CAD plugin list; there is no separate enable toggle to find.

### Set Your API ID

Don't forget to set your account [API ID](https://docs.sonoransoftware.com/cad/api-integration/getting-started/setting-your-api-id.md) to properly link your in-game user to the CAD.

## Configuration

Lookup caching is managed by the resource. Cache and purge timers are not exposed in the CAD editor.

## Usage

### Exported Functions

NOTE: For return object definitions, see the [Developer Documentation](https://docs.sonoransoftware.com/cad/api-integration/api-endpoints-v2/general/lookups/lookup-name-or-plate.md).

| Function | Arguments | Description | Returns |
| - | - | - | - |
| cadNameLookup | FirstName, MiddleInitial, LastName, callback | Looks up a character based on the arguments specified. | Objects containing character data and all associated objects. |
| cadPlateLookup | plate, basicFlag, callback, autoLookup | Looks up a vehicle based on specified plate number. | Objects containing vehicle data and all associated objects. |

#### Function Details

```lua theme={null}
--[[
    cadNameLookup
        first: First Name
        last: Last Name
        mi: Middle Initial
        callback: function called with return data
]]
function cadNameLookup(first, last, mi, callback)

--[[
    cadPlateLookup
        plate: plate number
        basicFlag: true returns cached record if possible which only contains vehicleRegistrations object, false calls the API
        callback: the function called with the return data
        autoLookup: when populated with an API ID, pops open a search window on the officer's CAD (optional)
]]
function cadPlateLookup(plate, basicFlag, callback, autoLookup)
```

## For Developers

This plugin also adds the commands `namefind` and `platefind` which takes the above arguments and prints the returned JSON object to the console.

### ACE Permissions

These developer commands are registered with FiveM command restriction enabled. Grant the exact nodes to a restricted developer or support role:

```cfg theme={null}
add_ace group.sonoran_cad_debug command.namefind allow
add_ace group.sonoran_cad_debug command.platefind allow
```

The command names are fixed in the current resource and are not configurable. They are intended for developer use, not general player access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.