CopyHero

Find Product Copies

POST
/api/v1/products/copies

Every copy of up to five products in your organization, in one call.

A copy is a product whose current gallery holds a flagged image (pHash equal, PDQ within pdq_max; only fingerprinted images compare) or that has the same supplier (source id, or the source URL in any http/https, www and trailing-slash spelling). One row per product and store link, labeled with exactly one group: excluded, deleted, library_only, imported_only, with_sales, same_store, candidate. matched_by reads image:1,3, supplier or followed (found through follow_supplier), joined with +. live_again_after_archive sees only archives applied through a product change, not ones made in the Shopify admin. counts cover every copy; filters narrow the listed rows; sort orders them by any row field or by change_created_at, pdq_distance or changed_at (default: product id, store id). count_only returns the counts alone; fields picks the row fields; changed_since lists only rows whose listing, store snapshot or newest change moved or that was deleted in the store since then (new sales and sync errors do not count as a change); pass next_cursor back as cursor for the next page. 404 for a product outside your organization or a flagged position with no image; 400 for a cursor of another request; 503 when finding the matches runs past its time limit (never a partial answer).

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
products*array<>
Items1 <= items <= 5
pdq_max?Pdq Max
Range0 <= value <= 64
Default31
include_supplier?Include Supplier
Defaulttrue
follow_supplier?Follow Supplier
Defaultfalse
exclude?array<>
sale_tags?array<string>
changed_since?|null
filters?

Every filter narrows the listed rows only; counts always cover every copy. Empty or absent means no filter on that field.

sort?array<>
Itemsitems <= 4
count_only?Count Only
Defaultfalse
fields?array<>|null
limit?Limit
Range1 <= value <= 500
Default200
cursor?string|null

Response Body

Successful Response

application/json
  1. response
products*array<>
next_cursor?string|null
Example Request
curl -X POST 'https://app.copyhero.app/api/v1/products/copies' \  -H 'Content-Type: application/json' \  -d '{  "products": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"    }  ]}'
Example Response
{  "products": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "counts": {        "property1": 0,        "property2": 0      },      "listed": 0,      "unhashed_images": [        0      ],      "copies": [        {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "group": "excluded",          "flags": [            "sale_tag_without_sales"          ],          "store": 0,          "backend_id": "string",          "url": "string",          "title": "string",          "handle": "string",          "status": "string",          "units": {            "all": 0,            "d7": 0,            "d30": 0          },          "sale_tags": [            "string"          ],          "change": {            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",            "status": "pending",            "created_at": "2019-08-24T14:15:22Z"          },          "sync_error": "string",          "matched_by": "string"        }      ]    }  ],  "next_cursor": "string"}