Count Metafield by Definition

Retrieve the count of metafield by definition Ids.

The Count Metafield by Definition API allows developers to retrieve the count of metafields associated with specified definition IDs.

This API is especially useful for:

  1. Analyzing metafield usage across your store
  2. Identifying frequently used definitions
  3. Monitoring custom field adoption

Request Parameters

Public Request Parameters

📘

Path Parameters

ParameterTypeRequiredDescriptionExample
owner_resourcestringYesThe owner resource type of the metafield"products", "orders"

Query Parameters

ParameterTypeRequiredDescriptionExample
definition_idsarray[string]YesArray of metafield definition IDs to count["mfd_123", "mfd_456"]

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeExampleDescription
codestring"success"Status code of the response
messagestringDescriptive message of the response
data.itemsarray[object][{...}]Array of metafield count objects
data.items.metafield_countint3242Number of metafields using this definition
data.items.definition_idstring"mfd_123"The metafield definition ID being counted

Error Response

FieldTypeExampleDescription
codestringInvalidParameterError http message
messagestring``Error message

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!