> For the complete documentation index, see [llms.txt](https://docs.sonoransoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonoransoftware.com/cad/integration-plugins/in-game-integration/available-plugins/lookups.md).

# Lookups

Implements name and plate lookups via the CAD.

{% hint style="warning" %}
This submodule utilizes API endpoints that require the **plus** version of Sonoran CAD or higher. For more information, view our [pricing ](/cad/pricing/faq.md)page.
{% endhint %}

{% hint style="danger" %}
This submodule is currently only used as a dependency for other submodules , and **does not have any in-game commands for general player usage**.
{% endhint %}

{% hint style="success" %}
Looking for VPS, web, or dedicated hosting? Check out our official [server hosting](broken://pages/-MRResNcPrj2q6MmmS6j)!
{% endhint %}

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

### 1. Download and Install the Core

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

### 2. Activate the Submodule and all Dependencies

Follow the [submodule activation guide](/cad/integration-plugins/in-game-integration/submodule-configuration.md#activating-a-submodule) for the required submodules.

### 3. Set Your API ID

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

## Configuration

{% hint style="warning" %}
Do not set the cache timer too low or you may run into rate limiting.
{% endhint %}

| Option          | Description                                                     | Default                  |
| --------------- | --------------------------------------------------------------- | ------------------------ |
| maxCacheTime    | How long to cache a looked-up plate.                            | 120 seconds              |
| stalePurgeTimer | How long between "stale" plate cleanups (keep unscanned plates) | 600 seconds (10 minutes) |

## Usage

### Exported Functions

NOTE: For return object definitions, see the [Developer Documentation](https://info.sonorancad.com/sonoran-cad/api-integration/api-endpoints/lookup-name-or-plate).

| 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
--[[
    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
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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sonoransoftware.com/cad/integration-plugins/in-game-integration/available-plugins/lookups.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
