# Apotek Hjartat Scraper — Swedish Pharmacy Products & Prices (`studio-amba/apotekhjartat-scraper`) Actor

Scrape products from Apotekhjartat.se, one of Sweden's largest pharmacy chains with 390+ stores. Medications, supplements, and personal care product data.

- **URL**: https://apify.com/studio-amba/apotekhjartat-scraper.md
- **Developed by:** [Jelle Desramaults](https://apify.com/studio-amba) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Apotek Hjartat Scraper -- Swedish Pharmacy Chain Products, Prices & Stock Availability

Extract products, prices, brands, stock status, ratings, and categories from [Apotek Hjartat](https://www.apotekhjartat.se) -- one of Sweden's largest pharmacy chains with over 390 physical stores and a comprehensive online shop covering medications, supplements, skincare, baby care, and personal wellness products.

### What is Apotek Hjartat Scraper?

Apotek Hjartat ("Heart Pharmacy") is Sweden's second-largest pharmacy chain by store count, operating more than 390 physical locations across the country alongside a well-established e-commerce platform. Part of the ICA Group (Sweden's largest food retailer), Apotek Hjartat combines the reach of a national pharmacy chain with the backing of Sweden's biggest retail conglomerate.

While Apotea dominates online-only pharmacy, Apotek Hjartat holds a unique position as an omnichannel player -- their pricing and product range bridge the gap between in-store pharmacy and online health retail. This makes their data valuable for both online and offline competitive analysis.

This actor scrapes product data from search results and product detail pages, extracting structured information via HTML parsing. What people build with it:

- **Omnichannel pricing analysis** -- pharmacy industry analysts compare Apotek Hjartat's online prices with online-only competitors like Apotea to understand the price premium (or discount) of chain pharmacy e-commerce.
- **Product range benchmarking** -- health brands and supplement manufacturers track their product presence, pricing, and categorisation across Sweden's pharmacy channels.
- **Retail pharmacy intelligence** -- competing pharmacy chains (Kronans Apotek, Lloyds Apotek) monitor Apotek Hjartat's online product offering and pricing strategy.
- **Healthcare market research** -- market research firms analyse the Swedish OTC medication and supplement market using structured product data from major pharmacy retailers.
- **Consumer health trends** -- researchers track bestselling products, rating patterns, and category trends in the Swedish health and wellness market.
- **Private label tracking** -- retailers developing their own pharmacy private labels study Apotek Hjartat's branded product offerings to identify white-space opportunities in the Swedish health market.

### What data does Apotek Hjartat Scraper extract?

Each product record includes:

- :pill: **Product name** -- full product title in Swedish
- :label: **Brand** -- manufacturer or brand name
- :moneybag: **Price** -- current price in SEK (Swedish kronor)
- :money_with_wings: **Original price** -- pre-discount price if the product is on sale
- :currency_exchange: **Currency** -- SEK
- :id: **Product ID** -- identifier from the URL slug
- :white_check_mark: **Stock status** -- availability based on stock indicators
- :star: **Rating** -- user rating score
- :speech_balloon: **Review count** -- number of customer reviews
- :camera: **Image** -- product image URL
- :page_facing_up: **Description** -- product description from meta tags
- :file_folder: **Category** -- product category from breadcrumb navigation
- :link: **URL** -- direct link to the product on apotekhjartat.se

### How to scrape Apotek Hjartat

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `searchQuery` | String | No | Search by keyword: `"vitaminer"` (vitamins), `"ibuprofen"`, `"solkram"` (sunscreen) |
| `categoryUrl` | String | No | Apotek Hjartat category URL to scrape |
| `maxResults` | Integer | No | Maximum products to return (default: 100, max: 10,000) |
| `proxyConfiguration` | Object | No | Proxy settings (Apify proxy recommended) |

**Tips:**

- Use **Swedish keywords** for the best results: `"vitaminer"` (vitamins), `"smorjmedel"` (moisturiser), `"tandkram"` (toothpaste), `"bloja"` (diaper), `"smartlindring"` (pain relief).
- For category scraping, browse apotekhjartat.se to find the product category URL you want and paste it into `categoryUrl`.
- The actor handles pagination automatically by following "Nasta" (Next) links.
- Default search is `"vitaminer"` if no input is provided.

### Output

```json
{
    "name": "Voltaren Gel 23,2 mg/g 100 g",
    "brand": "Voltaren",
    "price": 149,
    "originalPrice": 179,
    "currency": "SEK",
    "productId": "voltaren-gel-232-mg-g-100g",
    "inStock": true,
    "rating": 4.5,
    "reviewCount": 328,
    "imageUrl": "https://www.apotekhjartat.se/media/products/voltaren-gel-100g.jpg",
    "description": "Voltaren Gel innehaller diklofenak som lindrar smartor och inflammationer i muskler och leder. For utvart bruk vid akuta smartor.",
    "category": "Smartlindring",
    "url": "https://www.apotekhjartat.se/produkt/voltaren-gel-232-mg-g-100g",
    "scrapedAt": "2026-04-03T18:00:00.000Z"
}
````

### How much does it cost?

Apotek Hjartat Scraper uses CheerioCrawler for efficient HTML parsing:

| Volume | Estimated CUs | Estimated Cost |
|--------|--------------|----------------|
| 100 products | ~0.03 | ~$0.015 |
| 500 products | ~0.12 | ~$0.06 |
| 1,000 products | ~0.25 | ~$0.13 |
| 5,000 products | ~1.10 | ~$0.55 |

The actor first collects product links from listing pages, then visits each product page for detail extraction.

### Can I integrate?

Feed Swedish pharmacy chain data into your business systems:

- **Google Sheets** -- maintain a price comparison sheet between Apotek Hjartat and Apotea
- **Slack** -- get notified when specific health products go on sale
- **Zapier / Make** -- automate competitive pricing workflows for Swedish pharmacy e-commerce
- **Webhooks** -- stream product data to your own health product platform
- **PostgreSQL / BigQuery** -- build a Swedish pharmacy market price database
- **Power BI** -- visualise pricing trends and brand performance across Swedish pharmacies

### Can I use it as an API?

Yes. Integrate Swedish pharmacy pricing into your applications:

**Python:**

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("studio-amba/apotekhjartat-scraper").call(run_input={
    "searchQuery": "vitaminer",
    "maxResults": 100,
})

for product in client.dataset(run["defaultDatasetId"]).iterate_items():
    rating = f"{product['rating']}/5" if product.get('rating') else "no rating"
    print(f"{product['name']} | {product['price']} SEK | {rating}")
```

**JavaScript:**

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

const client = new ApifyClient({ token: "YOUR_API_TOKEN" });

const run = await client.actor("studio-amba/apotekhjartat-scraper").call({
    searchQuery: "vitaminer",
    maxResults: 100,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
const affordable = items.filter((p) => p.price > 0 && p.price < 100).sort((a, b) => a.price - b.price);
console.log(`${affordable.length} vitamin products under 100 SEK:`);
affordable.forEach((p) => console.log(`  ${p.name} - ${p.price} SEK`));
```

### FAQ

**What is the difference between Apotek Hjartat and Apotea?**
Apotea is an online-only pharmacy. Apotek Hjartat is a traditional pharmacy chain with 390+ physical stores plus an online shop. Apotek Hjartat is owned by the ICA Group (Sweden's largest food retailer).

**Are the prices the same online and in-store?**
Not necessarily. The actor scrapes online prices from apotekhjartat.se. In-store prices at physical Apotek Hjartat locations may differ.

**Does it capture prescription drug data?**
The actor scrapes publicly accessible product pages, which are primarily non-prescription (receptfria) items. Prescription drugs require login and are not accessible on public pages.

**Is data in Swedish only?**
Yes. All product names, descriptions, and categories are in Swedish. The platform serves the Swedish market.

**Can I compare prices with Apotea?**
Yes. Run both the Apotek Hjartat Scraper and the Apotea Scraper, then match products by EAN code or product name for a direct price comparison.

**How does Apotek Hjartat categorise products?**
Categories are extracted from breadcrumb navigation on product pages. Common top-level categories include: Halsa (Health), Hudvard (Skincare), Hygien (Hygiene), Barn & baby (Children & baby), and Smartlindring (Pain relief).

**How many products does Apotek Hjartat list online?**
Apotek Hjartat's online shop carries thousands of products across all pharmacy categories. The catalogue is smaller than Apotea's (which is online-only and optimised for maximum selection), but it includes many in-store-first products that other online pharmacies may not carry.

**Can I combine data from Apotek Hjartat and Apotea for price comparison?**
Yes. This is one of the most common use cases. Run both scrapers with the same search query, then match products by name or EAN code to build a cross-pharmacy price comparison matrix for the Swedish market.

**Does the actor extract whether a product is a medication or supplement?**
Not as a separate structured field. However, the category breadcrumb and description text typically indicate whether a product is classified as a medication (lakemedel) or dietary supplement (kosttillskott).

### Limitations

- Product detail extraction relies on HTML selectors which may change when Apotek Hjartat updates their website design.
- Not all products have rating and review data. Newer or less popular products may lack reviews.
- Stock status is inferred from class-based indicators on the page and may not always be accurate.
- The actor does not extract product ingredient lists or dosage information as structured fields -- these appear in the description text.
- Category URLs for listing pages may change as Apotek Hjartat reorganises their product taxonomy.

### Related Swedish and European pharmacy scrapers

- [Apotea Scraper](https://apify.com/studio-amba/apotea-scraper) -- Sweden's largest online-only pharmacy (direct competitor)
- [Prisjakt Scraper](https://apify.com/studio-amba/prisjakt-scraper) -- Nordic price comparison across all categories
- [Ceneo Scraper](https://apify.com/studio-amba/ceneo-scraper) -- Poland's price comparison platform (for European health product analysis)

### Your feedback

Need product ingredient extraction, in-store vs. online price comparison, or coverage of other Swedish pharmacy chains? Open an issue on GitHub or contact us through the Apify platform. We build features based on real user needs.

# Actor input Schema

## `categoryUrl` (type: `string`):

URL of a category page to scrape

## `searchQuery` (type: `string`):

Search term to find products

## `maxResults` (type: `integer`):

Maximum number of results

## `proxyConfiguration` (type: `object`):

Apify proxy settings

## Actor input object example

```json
{
  "searchQuery": "vitaminer",
  "maxResults": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("studio-amba/apotekhjartat-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("studio-amba/apotekhjartat-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call studio-amba/apotekhjartat-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=studio-amba/apotekhjartat-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Apotek Hjartat Scraper — Swedish Pharmacy Products & Prices",
        "description": "Scrape products from Apotekhjartat.se, one of Sweden's largest pharmacy chains with 390+ stores. Medications, supplements, and personal care product data.",
        "version": "0.1",
        "x-build-id": "NWdsCD9IuukaOQFhF"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/studio-amba~apotekhjartat-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-studio-amba-apotekhjartat-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/studio-amba~apotekhjartat-scraper/runs": {
            "post": {
                "operationId": "runs-sync-studio-amba-apotekhjartat-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/studio-amba~apotekhjartat-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-studio-amba-apotekhjartat-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "categoryUrl": {
                        "title": "Category URL",
                        "type": "string",
                        "description": "URL of a category page to scrape"
                    },
                    "searchQuery": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Search term to find products",
                        "default": "vitaminer"
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of results",
                        "default": 100
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Apify proxy settings",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
