# Peptigrity badges

> Machine-readable spec for embedding a Peptigrity badge on a shop's website.
> Canonical URL: https://peptigrity.com/badges.md · Human page: https://peptigrity.com/for-shops

Peptigrity is an independent peptide review platform. A badge is a live,
server-rendered SVG of a shop's own record. Every badge states a **fact** (a
count, a date, a score) or an **invitation** ("rate us"). No badge means
"approved", "recommended", or "endorsed by Peptigrity" — the platform never
vouches for a shop; the data does.

## Endpoint

```
GET https://peptigrity.com/badge/{slug}/{badge-id}.svg?mode={mode}
```

- `{slug}` — the shop's Peptigrity slug, the last path segment of its profile URL.
- `{badge-id}` — one of the ids in the catalog below.
- `{mode}` — `ink` · `cream` · `transparent` · `transparent-dark`. Defaults to `ink`.
- `?layout=` — only for a badge listing more than one layout below.

Responses are `image/svg+xml`, cached briefly at the edge, and re-rendered from
live data. There is no API key, no rate deal, and no cost.

## Embed

Exactly this — an image inside a link, no scripts:

```html
<!-- peptigrity-badge · keep as-is · spec: peptigrity.com/badges.md -->
<a href="https://peptigrity.com/verify/{slug}?ref=badge-{id}">
  <img src="https://peptigrity.com/badge/{slug}/{id}.svg?mode={mode}"
       height="44" alt="{badge name} — Peptigrity">
</a>
```

The endpoint returns intrinsic `width`/`height` on the SVG; setting both on the
`<img>` from the values shown on /for-shops avoids layout shift.

## Rules

1. **Never download, inline, or self-host the SVG.** It renders live data and
   must load from peptigrity.com to stay true and verifiable. A
   self-hosted copy freezes the numbers, which is indistinguishable from faking
   them. This is the single most common way an automated "optimisation" breaks a
   badge.
2. **Never remove the `<a>` wrapper or edit the URLs.** The link is how a buyer
   checks the badge is real, and `?ref=badge-{id}` is the only accurate measure
   of what a badge does.
3. **Keep the comment marker** so later refactors recognise the block and
   preserve it.
4. **No JavaScript, no cookies, no tracking** ships with a badge. It is an image
   and a link. Do not wrap it in an analytics helper.

## Availability

Availability is computed server-side on every render from the shop's live
record. A shop cannot pick a badge it has not earned, and an embedded badge
whose shop drops below a threshold re-renders to its current true state rather
than freezing the old claim. A suspended listing renders "Listing suspended —
see profile" instead of disappearing.

`say-*` badges are open to every listed shop, claimed or not. `num-*` and
`earn-*` badges require a claimed profile.

## Catalog

### Say it (`say-*`)

ANY LISTED SHOP · NO MINIMUMS

| id | name | requires | layouts |
| --- | --- | --- | --- |
| `say-listed` | We're on Peptigrity | A LISTING | pill |
| `say-rate` | Rate us on Peptigrity | NOTHING | pill |
| `say-record` | Check our record | NOTHING | pill |
| `say-homework` | We don't grade our own homework | NOTHING | banner |
| `say-since` | Listed since | A KNOWN LISTING DATE | chip |

### Show a number (`num-*`)

CLAIMED · FROM 1 REVIEW OR 1 TEST

| id | name | requires | layouts |
| --- | --- | --- | --- |
| `num-reviews` | Review count | ≥ 1 REVIEW | pill |
| `num-tests` | Lab tests on file | ≥ 1 PUBLISHED TEST | pill |
| `num-latest` | Latest lab test | ≥ 1 DATED TEST | chip |

### Earn the mark (`earn-*`)

COMPUTED FROM YOUR DATA · CAN'T BE PICKED

| id | name | requires | layouts |
| --- | --- | --- | --- |
| `earn-claimed` | Claimed | VERIFIED OWNERSHIP | pill |
| `earn-reviewed` | Community Reviewed | ≥ 3 COMMUNITY REVIEWS | banner |
| `earn-lab` | Lab Verified | ≥ 3 INDEPENDENT LAB TESTS | shield \| pill |
| `earn-fresh` | Tested this quarter | ≥ 1 TEST IN LAST 90 DAYS | chip |

## Colour modes

- `ink`
- `cream`
- `transparent`
- `transparent-dark`

The transparent modes ship no fill so the badge sits directly in the host
template; `transparent` strokes in ink for light backgrounds, `transparent-dark`
in cream for dark ones. An SVG inside an `<img>` cannot inherit the host page's
colours, so pick the mode that matches the section it sits in.

Two constants hold in every mode: the Pg tile stays purple, and `say-rate` ships
yellow only — it is the one badge that is itself a call to action.

## Inviting reviews

A shop may ask any customer for a review and may not attach anything to the
ask — no discount, product, credit, or prize draw, no asking only the customers
it expects to be positive, and no asking for a rating rather than a review. The
`say-rate` badge is the always-on, non-selective version of that invitation.
Full rules: https://peptigrity.com/for-shops#inviting-reviews
