# Store Currency Locale Detector (`eichan/store-currency-locale-detector`) Actor

- **URL**: https://apify.com/eichan/store-currency-locale-detector.md
- **Developed by:** [Eichan Jolly](https://apify.com/eichan) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Store Currency & Locale Detector

Inspect **one public store homepage** and return a single summary row of its HTML `lang` attribute and currency **hints** from JSON-LD, price-related meta tags, and visible price text/symbols. A hint is **not proof** of the checkout currency; currencies can vary by country, account, or session.

### Who is this for?

Storefront QA teams, market researchers, and developers assessing currency presentation from public metadata. This Actor is not a payment or checkout inspector and does not browse product pages.

### Quick start / real prefilled demonstration

This public Plus-Plus UK homepage was independently observed on **2026-11-01** displaying prices with `GBP` on the page. It provides a realistic, non-placeholder first run. Site content may change.

```json
{
  "storeUrl": "https://www.plus-plus.co.uk/"
}
```

Example output from the **local fixture modeled on the public signals** (the live page may have more JSON-LD/meta signals):

```json
{
  "url": "https://www.plus-plus.co.uk/",
  "htmlLang": "en-GB",
  "detectedCurrencies": [
    {
      "currency": "GBP",
      "source": "text-symbol",
      "evidence": "Visible price statement: All prices are in GBP."
    }
  ],
  "likelyCurrency": "GBP",
  "signals": [
    "HTML lang is en-GB; language is not used to infer currency.",
    "Visible price statement: All prices are in GBP.",
    "GBP is the only supported currency hint; checkout may differ by region."
  ],
  "status": "ok",
  "error": null
}
```

`htmlLang` from this example is **a local fixture value**, not a claim that the site's live `<html>` element has precisely that value.

### Fields and confidence policy

- `url`: the supplied, validated homepage URL.
- `htmlLang`: literal HTML `lang`, or `null`. **Never used for currency inference.**
- `detectedCurrencies`: list of `{currency, source, evidence}`. `source` is one of `jsonld`, `meta`, or `text-symbol`. An ambiguous `$` or `¥` symbol is represented with `currency: null` rather than guessing USD/CAD/AUD or JPY/CNY.
- `likelyCurrency`: one unambiguous, nonconflicting public currency hint, or `null` if none / conflict.
- `signals`: list of plain-language evidence strings and any conflict/uncertainty explanation.
- `status`: `ok` or `error`.
- `error`: plain-language error description or `null`.

The Actor recognizes a bounded set of common ISO currency codes: USD, GBP, EUR, CAD, AUD, JPY, NZD, CHF, SEK, NOK, DKK, INR, KRW, SGD, HKD. From JSON-LD it reads only `priceCurrency`; from meta it reads price/currency-related tags; from visible text it reads explicit price-code phrases, prices with ISO codes, and recognizable currency symbols. Repeated signals of the same type/code are deduplicated. If conflicting codes are detected, `likelyCurrency` is `null`, even if one looks stronger. Mere dollar/yen symbols cannot establish currency.

On download failure the Actor emits exactly one row with `status: "error"`, empty `detectedCurrencies` and `signals`, null locale/currency, and a readable `error`.

### Limits and responsible use

- Only the **one homepage URL you provide** is fetched. No crawling, logins, browser automation, external APIs, or checkout interaction.
- HTML-only extraction: client-side content absent from the initial HTML is not seen. Price displays localized per IP, cookie, device, or account may differ.
- A `£` symbol is a GBP *hint*, not a checkout guarantee. No country inference from `.co.uk`, language or store name.
- 15-second timeout, 2 MB HTML response limit, same-host redirects only, public network addresses only. 403/404/timeouts produce plain-language errors.
- Only use public sites that permit automated access. No Amazon/eBay scraping.

### Run locally (Python 3.12+; no dependencies)

```bash
ACTOR_INPUT_JSON='{"storeUrl":"https://www.plus-plus.co.uk/"}' python src/main.py
```

Local output is saved to `storage/datasets/default/000000001.json` and subsequent numbered files. Alternatively place an input JSON object in `storage/key_value_stores/default/INPUT.json`.

On Apify, `INPUT` is fetched from the default key-value store via the official REST API, authenticated with platform-provided `APIFY_TOKEN`. Output is POSTed to the default dataset via REST, with no Apify SDK or dependencies.

### Reproduce verification

```bash
python -m unittest discover -s tests -p 'test_*.py' -v
python tests/run_smoke.py
```

The smoke runner creates an isolated Python virtual environment (stdlib only) and executes the production file in a **real subprocess** via `python src/main.py`, with test-only HTTP fixture substitution at interpreter startup. It records real stdout, stderr, exit code, and dataset output in `tests/smoke_evidence.txt` and `tests/smoke_dataset.json`. This tests script-mode correctness; it is **not** a live HTTP or Apify deployment test.

### Suggested Apify Store details (not activated)

- Category: **ECOMMERCE** (E-commerce).
- Suggested price: **USD $2 per 1,000 successful summaries** ($0.002 per summary). Do not charge for error items if billing is later implemented.
- Proposal only; see `store_metadata.json`. Publishing and billing are **not configured**.

# Actor input Schema

## `storeUrl` (type: `string`):

One publicly reachable HTML page; no login required.

## Actor input object example

```json
{
  "storeUrl": "https://www.allbirds.com/"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing the Actor's result items

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "storeUrl": "https://www.allbirds.com/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("eichan/store-currency-locale-detector").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "storeUrl": "https://www.allbirds.com/" }

# Run the Actor and wait for it to finish
run = client.actor("eichan/store-currency-locale-detector").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "storeUrl": "https://www.allbirds.com/"
}' |
apify call eichan/store-currency-locale-detector --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eichan/store-currency-locale-detector"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/C2ySAa7CNNe8VYk8P/builds/ycV4jc2by5GE0lBbh/openapi.json
