GunSpec

Stats

Resource class for interacting with the GunSpec Statistics API. Wraps all /v1/stats endpoints. Instantiated internally by the GunSpec client and exposed as client.stats.

Authentifizierung erforderlichExplorer+

Get a high-level summary of the database.

summary(): Promise<APIResponse<StatsSummary>>
GET/v1/stats/summary

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • object

    The response payload.

  • integer

    Firearms in the catalog.

  • integer

    Manufacturers in the catalog. Counts rows, so it exceeds the number of makers with a catalogued firearm.

  • integer

    Cartridges in the catalog.

  • integer

    Distinct countries of origin across the catalog.

  • number

    Mean data_confidence across the catalog, as a percentage rather than the 0-1 the per-record field uses.

  • integer

    Firearms that are a variant of another, meaning those carrying a parentFirearmId.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Explorer+
Monatskontingent
200/mo
Anfragerate
10/min
Tageslimit
50

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Dieser Aufruf beantwortet bedingte Anfragen. Speichern Sie das ETag einer Antwort und senden Sie es als If-None-Match zurueck: ein unveraenderter Datensatz liefert 304 Not Modified ohne Body. Das zaehlt auf Ihr Minutenlimit, aber nicht auf Ihr Tageskontingent.

Authentifizierung erforderlichExplorer+

Get firearm counts grouped by production status.

productionStatus(): Promise<APIResponse<ProductionStatusItem[]>>
GET/v1/stats/production-status

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • object[]

    The response payload.

  • string | null

    Production status, one of in_production, discontinued, out_of_production, in_service, limited_production, prototype. Discontinued records are kept deliberately: a rifle built in 2004 wears parts nobody sells today.

  • integer

    How many records fall in this bucket.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Explorer+
Monatskontingent
200/mo
Anfragerate
10/min
Tageslimit
50

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichExplorer+

Get field coverage statistics across the database. Shows the percentage of firearms that have data for each field, useful for assessing data completeness.

fieldCoverage(): Promise<APIResponse<FieldCoverage>>
GET/v1/stats/field-coverage

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • object[]

    The response payload.

  • string

    Which column the row is about, named as the database names it.

  • number

    Share of records, 0 to 100.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Explorer+
Monatskontingent
200/mo
Anfragerate
10/min
Tageslimit
50

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichExplorer+

Get the most popular calibers by firearm count.

popularCalibers(params?: PopularCalibersParams): Promise<APIResponse<PopularCaliber[]>>
GET/v1/stats/calibers/popular

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • integerstandard20

    How many to return

    Bereich
    1 – 100
    Beispiel

  • object[]

    The response payload.

  • string

    Slug of the cartridge.

  • string

    Display name, as the maker writes it.

  • string | null

    NATO designation where the cartridge has one. Null otherwise.

  • integer

    How many catalogued firearms chamber it.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Explorer+
Monatskontingent
200/mo
Anfragerate
10/min
Tageslimit
50

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichExplorer+

Get the most prolific manufacturers by firearm count.

prolificManufacturers(params?: ProlificManufacturersParams): Promise<APIResponse<ProlificManufacturer[]>>
GET/v1/stats/manufacturers/prolific

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • integerstandard20

    How many to return

    Bereich
    1 – 100
    Beispiel
  • string

    Restrict to a category slug

    Beispiel

  • object[]

    The response payload.

  • string

    Slug of the manufacturer.

  • string

    Display name, as the maker writes it.

  • string | null

    ISO 3166-1 alpha-2 code of where they are based.

  • integer

    How many catalogued firearms they make.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Explorer+
Monatskontingent
200/mo
Anfragerate
10/min
Tageslimit
50

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichExplorer+

Get firearm counts grouped by category.

byCategory(): Promise<APIResponse<CategoryStats[]>>
GET/v1/stats/by-category

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • object[]

    The response payload.

  • string

    Slug of the category.

  • string

    Display name, as the maker writes it.

  • integer

    How many catalogued firearms are in it.

  • number | null

    Mean unloaded weight in grams across the category, over the firearms that record one.

  • number | null

    Mean magazine capacity across the category, over the firearms that record one.

  • number | null

    Mean barrel length in millimetres across the category, over the firearms that record one.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Explorer+
Monatskontingent
200/mo
Anfragerate
10/min
Tageslimit
50

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichStudio+

Get firearm statistics for a specific decade/era.

byEra(params: ByEraParams): Promise<APIResponse<EraStats>>
GET/v1/stats/by-era

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • stringerforderlich

    Decade to report on, formatted like "1990s"

    Beispiel

  • object

    The response payload.

  • integer

    Firearms introduced in the decade.

  • number | null

    Mean unloaded weight in grams, over those that record one.

  • number | null

    Mean magazine capacity, over those that record one.

  • number | null

    Mean barrel length in millimetres, over those that record one.

  • integer | null

    Earliest introduction year inside the decade that any record carries.

  • integer | null

    Latest introduction year inside the decade that any record carries.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Studio+
Monatskontingent
150,000/mo
Anfragerate
120/min
Tageslimit
10,000

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichStudio+

Get statistics about materials used across all firearms.

materials(): Promise<APIResponse<MaterialStats>>
GET/v1/stats/materials

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • object

    The response payload.

  • object[]

    Frame materials, and how many firearms use each.

  • string

    The material as recorded on the firearm.

  • integer

    How many records fall in this bucket.

  • object[]

    Slide materials, and how many firearms use each.

  • string

    The material as recorded on the firearm.

  • integer

    How many records fall in this bucket.

  • object[]

    Barrel materials, and how many firearms use each.

  • string

    The material as recorded on the firearm.

  • integer

    How many records fall in this bucket.

  • object[]

    Stock materials, and how many firearms use each.

  • string

    The material as recorded on the firearm.

  • integer

    How many records fall in this bucket.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Studio+
Monatskontingent
150,000/mo
Anfragerate
120/min
Tageslimit
10,000

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichStudio+

Get firearm adoption statistics for a specific country.

adoptionByCountry(params: AdoptionByCountryParams): Promise<APIResponse<AdoptionByCountryItem[]>>
GET/v1/stats/adoption/by-country

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • stringerforderlich

    ISO 3166-1 alpha-2 country code

    Max. Länge
    10
    Beispiel

  • object[]

    The response payload.

  • integer

    Numeric id of the adoption record itself, not of the firearm.

  • string | null

    The organisation that adopted the firearm.

  • string | null

    Kind of operator: one of military, law_enforcement, civilian, paramilitary, special_forces, private_security, training.

  • integer | null

    Year the operator adopted it. Null where the date is unrecorded.

  • string | null

    Military or standards designation for the load, e.g. M882.

  • string

    Slug of the adopted firearm.

  • string

    Display name of the firearm.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Studio+
Monatskontingent
150,000/mo
Anfragerate
120/min
Tageslimit
10,000

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichStudio+

Get firearm adoption statistics by usage type.

adoptionByType(params: AdoptionByTypeParams): Promise<APIResponse<AdoptionByTypeItem[]>>
GET/v1/stats/adoption/by-type

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • stringerforderlich

    Operator type

    Akzeptiert
    Beispiel

  • object[]

    The response payload.

  • string

    Slug of the adopted firearm.

  • string

    Display name of the firearm.

  • integer

    How many operators of this type adopted it.

  • string[]

    ISO 3166-1 alpha-2 codes of the countries those operators belong to.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Studio+
Monatskontingent
150,000/mo
Anfragerate
120/min
Tageslimit
10,000

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichExplorer+

Get firearm counts grouped by action type.

actionTypes(params?: ActionTypesParams): Promise<APIResponse<ActionTypeStats[]>>
GET/v1/stats/action-types

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • string

    Restrict to a category slug

    Beispiel

  • object[]

    The response payload.

  • string | null

    The action as stored, and the value to send as action_type when filtering.

  • integer

    How many records fall in this bucket.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Explorer+
Monatskontingent
200/mo
Anfragerate
10/min
Tageslimit
50

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichBuilder+

Get feature frequency statistics across the database.

featureFrequency(params?: FeatureFrequencyParams): Promise<APIResponse<FeatureFrequency[]>>
GET/v1/stats/feature-frequency

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • string

    Restrict to a category slug

    Beispiel
  • integerstandard50

    How many to return

    Bereich
    1 – 100
    Beispiel

  • object[]

    The response payload.

  • string

    The feature as stored, and the value to send as feature to /v1/firearms/by-feature.

  • integer

    How many records fall in this bucket.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Builder+
Monatskontingent
25,000/mo
Anfragerate
60/min
Tageslimit
2,000

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichStudio+

Get caliber popularity trends across historical eras.

caliberPopularityByEra(params?: CaliberPopularityByEraParams): Promise<APIResponse<CaliberPopularityByEra[]>>
GET/v1/stats/caliber-popularity-by-era

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • string

    Earliest decade, formatted like "1940s"

    Beispiel
  • string

    Latest decade, formatted like "2020s"

    Beispiel

  • object[]

    The response payload.

  • string

    The decade this row covers, e.g. 1940s.

  • object[]

    The cartridges chambered by firearms introduced in this decade.

  • string

    Slug of the cartridge. Resolve against /v1/calibers/{id}.

  • string

    Display name of the cartridge.

  • integer

    How many firearms this row covers.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Studio+
Monatskontingent
150,000/mo
Anfragerate
120/min
Tageslimit
10,000

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.

Authentifizierung erforderlichExplorer+

Get catalog completeness percentages. Reports what share of firearms have a line-art image, core specifications filled, at least one caliber mapped, and a recorded weight. Computed live.

catalogCoverage(): Promise<APIResponse<CatalogCoverage>>
GET/v1/stats/catalog-coverage

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • object

    The response payload.

  • integer

    Total records matching the query across every page.

  • number

    Percentage of firearms carrying at least one image.

  • number

    Percentage of firearms carrying at least one recorded specification.

  • number

    Percentage of firearms with at least one caliber recorded.

  • number

    Percentage of firearms with an unloaded weight recorded.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Mindeststufe
Explorer+
Monatskontingent
200/mo
Anfragerate
10/min
Tageslimit
50

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.