Firearms

Resolve many names at once

The batch form of name resolution: up to 50 queries, one round trip, results returned in the order they were sent.

This is the shape an agent needs. Extracting the firearms named in a document, a forum thread or a spreadsheet column means resolving dozens of names at once, and doing that one request at a time is the difference between a call that can be made inline and one that cannot. Every query is scored exactly as the single form scores it.

Requires Studio tier or higher.

post/v1/firearms/resolve

Request

  • Base URL: https://api.gunspec.io
  • URL: https://api.gunspec.io/v1/firearms/resolve
  • Auth: one of:
    • API key in header X-API-Key
    • HTTP bearer

Request body

queriesstring[] required

The names to resolve. Between 1 and 50, each up to 200 characters.

Example request

{
  "queries": [
    "AK-47"
  ]
}

Response

One result per query. A query that resolved to nothing is a result with status: "not_found", never an error: one unknown name does not fail the batch.

successboolean required

Always true on a successful response. Every error carries false and an error object instead.

Example response

{
  "success": true,
  "data": {
    "results": [
      {
        "query": "G19 gen 5 MOS",
        "status": "resolved",
        "firearmId": "glock-19-gen5",
        "match": "shorthand",
        "score": 0.6,
        "matchedTokens": [
          "g19"
        ],
        "unresolvedTokens": [
          "mos"
        ],
        "alternatives": [
          {
            "firearmId": "glock-19-gen5",
            "name": "Glock 19 Gen5",
            "manufacturerName": "Glock",
            "match": "shorthand",
            "matchedAlias": "G19 Gen5",
            "score": 0.6
          }
        ]
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.