UZ Scripts
uz_AutoShot

HTTP API

REST API reference for uz_AutoShot — manifest endpoints, image serving, and photo existence checks.

HTTP API

The Node.js backend runs on http://127.0.0.1:3959. All endpoints return JSON (except image serving) and include CORS headers for direct NUI access.


Endpoints

GET /api/manifest

Returns all captured photos.

GET http://127.0.0.1:3959/api/manifest

Response:

{
  "generatedAt": 1711234567890,
  "total": 1240,
  "items": [
    {
      "url": "http://127.0.0.1:3959/shots/male/11/5_0.png",
      "file": "male/11/5_0.png",
      "gender": "male",
      "type": "component",
      "id": 11,
      "drawable": 5,
      "texture": 0
    }
  ]
}

GET /api/manifest/:gender

Filter by gender.

GET http://127.0.0.1:3959/api/manifest/male
GET http://127.0.0.1:3959/api/manifest/female

GET /api/manifest/:gender/:type/:id

Filter by specific category. type is component or prop.

# All male tops (component 11)
GET http://127.0.0.1:3959/api/manifest/male/component/11

# All female hats (prop 0)
GET http://127.0.0.1:3959/api/manifest/female/prop/0

Response:

{
  "generatedAt": 1711234567890,
  "total": 55,
  "items": [
    { "url": "http://127.0.0.1:3959/shots/male/11/0.png", "drawable": 0, "texture": 0 },
    { "url": "http://127.0.0.1:3959/shots/male/11/1.png", "drawable": 1, "texture": 0 },
    { "url": "http://127.0.0.1:3959/shots/male/11/2.png", "drawable": 2, "texture": 0 }
  ]
}

GET /api/exists

Check if a specific photo has been captured.

GET http://127.0.0.1:3959/api/exists?gender=male&type=component&id=11&drawable=5&texture=0

Response:

{ "exists": true }

GET /api/stats

Summary statistics for all captured photos.

GET http://127.0.0.1:3959/api/stats

Response:

{
  "total": 1240,
  "byGender": { "male": 800, "female": 440 },
  "byType": { "component": 1100, "prop": 140 }
}

GET /shots/...

Serves the actual image files. Supports .png, .webp, and .jpg.

# Direct image URL
GET http://127.0.0.1:3959/shots/male/11/5_0.png
GET http://127.0.0.1:3959/shots/female/prop_0/3.png

Images are served with Cache-Control: no-cache to ensure fresh content after re-captures.


Directory Structure

Photos are organized in the shots/ directory:

shots/
├── male/
│   ├── 1/              # Mask (component 1)
│   │   ├── 0.png       # drawable 0, texture 0
│   │   ├── 1.png       # drawable 1, texture 0
│   │   └── 2_1.png     # drawable 2, texture 1
│   ├── 11/             # Tops (component 11)
│   └── prop_0/         # Hats (prop 0)
└── female/
    ├── 11/
    └── prop_0/

Naming convention:

  • Components: {gender}/{componentId}/{drawableId}.png or {gender}/{componentId}/{drawableId}_{textureId}.png
  • Props: {gender}/prop_{propId}/{drawableId}.png or {gender}/prop_{propId}/{drawableId}_{textureId}.png
  • Texture suffix is omitted when textureId is 0

GTA V Category Reference

Components (clothing)

Component IDLabelCamera Preset
1Maskhead
3Arms / Glovestorso
4Pantslegs
5Bagsbags
6Shoesshoes
7Accessoriesaccessories
8Undershirttorso
9Body Armortorso
10Decalstorso
11Topstorso

Props (accessories)

Prop IDLabelCamera Preset
0Hatshats
1Glassesglasses
2Earsears
6Watcheswatches
7Braceletsbracelets

On this page