> For the complete documentation index, see [llms.txt](https://docs.shoplift.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shoplift.ai/api-reference/public-api-1/shoplift-api/shoplift-api-with-claude.md).

# Shoplift API with Claude

## Use the Shoplift API with Claude

The Shoplift API is designed to work with AI assistants. Give Claude two things, your API key and the Shoplift API reference, and you can run your entire testing program in plain English: create tests, launch them, pause them, and pull results without writing a line of code yourself.

This guide uses Claude Code, Anthropic's agentic coding tool, because it can make API requests and read local files on your behalf. The same approach works in any AI tool that can execute HTTP requests.

### Setup

1. **Get your API key.** Follow [Get and manage your API key](/api-reference/public-api-1/shoplift-api/shoplift-api-key.md). Put the key somewhere Claude can read it, for example an `.env` file in your working directory.
2. **Give Claude the API reference.** Point Claude at the hosted API reference at `docs.shoplift.ai/api-reference/public-api-1/shoplift-api`. Shoplift's documentation is agent-readable: any page is available as plain Markdown by appending `.md` to its URL, so Claude can pull exactly the endpoint documentation it needs. You can also download the reference from the **API docs** link on the **Settings > API** page and save it in your working directory if you prefer to work offline.&#x20;

{% hint style="info" %}
Read [Keep your key secret](/api-reference/public-api-1/shoplift-api/shoplift-api-key.md#keep-your-key-secret) before you start. Giving an assistant your key grants it full write access to your store's tests.&#x20;
{% endhint %}

That's the whole setup. Claude reads the reference, learns the endpoints, and handles authentication, request formatting, and error handling on its own.

### Workflow 1: Create and manage tests with Claude

With the key and reference in place, describe what you want in plain language.

**Create a test:**

```
You have access to a directory with a .env file containing my Shoplift API key,
and the Shoplift API reference PDF. Set up a URL redirect test comparing
/pages/original against /pages/new-landing, optimizing for conversion rate.
Let me know if you need anything from my side.
```

Claude reads the reference, builds the request, and creates the test in draft state. New tests are never live until you launch them, so there's a natural checkpoint to review the draft in your dashboard before anything reaches visitors.

**Launch, pause, or end it:**

```
That draft looks right. Please launch it.
```

```
Pause the test we just launched.
```

Claude doesn't mind typos or shorthand, and it will confirm state changes against the API's responses. A successful launch or pause returns immediately, and refreshing your Shoplift dashboard shows the updated status.

**Organize as you go:**

```
Create that test with the tag "summer-sale", priority High, impact 4, effort 2.
```

**Pull and interpret results:**

```
Find the test named "Product Page Test" and pull its results.
Tell me what happened.
```

This is where an assistant earns its keep. Instead of a raw JSON payload, you get an interpretation: the traffic split, the observed lift, which metrics moved, the Bayesian win probability, and how far through its sample size the test got. If a test was ended early, Claude can tell you whether the trend was promising and how conclusive the data actually was.

### Workflow 2: Add Shopify CLI for theme tests

Theme tests require Shopify theme IDs, which the Shoplift API doesn't provide. If you have the Shopify CLI installed and authenticated, Claude can pull your theme IDs itself and use them directly.

```
Set up a theme test comparing my current live theme against the variant theme
titled "Variant Theme One". You have Shopify CLI available if you need theme IDs.
```

Claude lists your themes through the CLI, identifies the live theme and the variant by name, and creates the theme test with the correct IDs. Because it can see both themes, it can also catch and fix comparability issues before launch. In Shoplift's own testing, Claude noticed the variant theme was missing a template that existed on the live theme, copied it over, and confirmed both themes were aligned before creating the test, all without being asked.

This combination of the Shoplift API and the Shopify CLI lets you manage your store's testing program end to end from a single Claude session: inspect themes, fix template gaps, create the test, launch it, and pull the results.

### Example prompts

A starting set, from simplest to most involved:

```
List my active tests and summarize what each one is measuring.
```

```
Create a draft template test on the product page using Duplicate mode,
optimizing for revenue per session.
```

```
Schedule that test to start Monday at 8am Eastern and end automatically
when it reaches significance.
```

```
Create a custom audience for US visitors from paid channels, then create
a mobile-only test limited to that audience.
```

```
Pause everything tagged 'summer-sale'.
```

```
Pull results for every test that ended in the last 90 days, and tell me
which winners we haven't implemented yet.
```

```
Compare my live theme against 'Holiday Theme 2026' in a theme test.
Check both themes for missing templates first.
```

### Tips

**Reference tests by name.** Claude can look up a test's ID from its title through the list endpoint, so you don't need to copy UUIDs around. If you do paste an ID and it returns a `404`, ask Claude to find the test by name instead. The ID you copied may belong to a different test.

**Drafts are your safety net.** Tests are created in draft state and only go live when launched. If Claude sets up something you didn't intend, delete the draft and try again.&#x20;

**Mind the rate limit.** The API allows 60 requests per minute. For bulk operations across many tests, Claude will paginate and pace requests, but very large batch jobs may take a few minutes.

### Still need help?

Contact the Shoplift support team if you have questions about using the Shoplift API with Claude.
