# FatSecret Scraper (`dadhalfdev/fatsecret-scraper`) Actor

Scrape foods and nutrition facts from FatSecret. Use the same search filters as the site or paste a URL — the URL wins when set.

- **URL**: https://apify.com/dadhalfdev/fatsecret-scraper.md
- **Developed by:** [Marco Rodrigues](https://apify.com/dadhalfdev) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## 🥗 FatSecret Scraper

Want [FatSecret](https://foods.fatsecret.com/) food pages in a spreadsheet? This scraper makes it easy.

Use **structured filters** — better for AI agents — **or** paste an **`input_url`**. When `input_url` is set it overrides the filters.

FatSecret is a worldwide food database. Search by keyword, leave the keyword empty to walk foods A–Z, or paste a single food page. This actor opens each food page and returns up to 2000 rows per run.

### 💡 Perfect for...

- **Nutrition apps:** Export calories, fat, carbs, protein, and common serving sizes from the food page.
- **Dashboards:** Compare the same food across country sites.
- **Market research:** Browse branded products or generic / USDA foods without paging the site.
- **Data analysts:** Export structured rows with public food-page URLs, photos, and related foods.
- **🤖 AI Agents:** Power Claude, Cursor, Codex, the Hermes Agent, and OpenClaw workflows with live FatSecret results.
- **📚 RAG Systems:** Feed food names, descriptions, and nutrition facts into retrieval pipelines.
- **🔗 AI Workflows:** Plug into LangChain, AutoGPT, CrewAI, and similar stacks.

### ✨ Why you'll love this scraper

- 🔗 **Input URL or Filters:** Paste a FatSecret food page, search, or A–Z list URL, or pick a country and keyword. `input_url` always wins when set.
- 🎯 **Website-Matched Filters:** Keyword, country site, and A–Z browse set (all / generic foods / USDA / brands).
- 🌐 **Full food pages:** Title, brand, serving, calories, macros, common serving sizes, photos, and related foods.

### 📦 What's inside the data?

`id`, `url`, `title`, `brand`, `description`, `serving`, `calories_kcal`, `fat_g`, `carbs_g`, `protein_g`, `fat_pct`, `carbs_pct`, `protein_pct`, `rdi_percent`, `servings`, `photos`, `related`, `country`, `source`

### 🚀 Quick start

**Option A:** paste a food page such as `https://foods.fatsecret.com/calories-nutrition/generic/chicken-breast-ns-as-to-skin-eaten`.
**Option B:** paste a search such as `https://foods.fatsecret.com/calories-nutrition/search?q=chicken`.
**Option C:** pick a country, type a keyword (or leave it empty to browse A–Z), and set `max_results`.

**Input Example (filters):**

```json
{
  "query": "chicken",
  "country": "us",
  "max_results": 100
}
```

**Input Example (URL):**

```json
{
  "input_url": "https://foods.fatsecret.com/calories-nutrition/generic/chicken-breast-ns-as-to-skin-eaten",
  "max_results": 1
}
```

**Output Example:**

```json
{
  "id": "generic/chicken-breast-ns-as-to-skin-eaten",
  "url": "https://foods.fatsecret.com/calories-nutrition/generic/chicken-breast-ns-as-to-skin-eaten",
  "title": "Chicken Breast",
  "brand": null,
  "description": "There are 195 calories in 100 grams of Chicken Breast.",
  "serving": "100 grams",
  "calories_kcal": 195,
  "fat_g": 7.72,
  "carbs_g": 0,
  "protein_g": 29.55,
  "fat_pct": 37,
  "carbs_pct": 0,
  "protein_pct": 63,
  "rdi_percent": 10,
  "servings": [
    {
      "name": "1 oz raw",
      "note": "yield after cooking, bone removed",
      "calories_kcal": 29
    },
    {
      "name": "100 g",
      "note": null,
      "calories_kcal": 195
    }
  ],
  "photos": [
    "https://m.ftscrt.com/food/b0ab0c4e-442a-4ddc-8ace-404d1907df8b.jpg"
  ],
  "related": [
    {
      "title": "Skinless Chicken Breast",
      "url": "https://foods.fatsecret.com/calories-nutrition/generic/chicken-breast-skinless"
    }
  ],
  "country": "United States",
  "source": "generic"
}
```

**Output fields:**

| Field | Description |
|-------|-------------|
| `id` | Food id from the public page path. |
| `url` | Public food page. |
| `title` | Food name on the page. |
| `brand` | Brand name when the food is a branded product. |
| `description` | Short nutrition sentence from the food page. |
| `serving` | Serving size the calories apply to. |
| `calories_kcal` | Calories in kcal for that serving. |
| `fat_g` | Fat in grams. |
| `carbs_g` | Carbohydrates in grams. |
| `protein_g` | Protein in grams. |
| `fat_pct` | Share of calories from fat. |
| `carbs_pct` | Share of calories from carbs. |
| `protein_pct` | Share of calories from protein. |
| `rdi_percent` | Percent of a 2000 calorie recommended daily intake. |
| `servings` | Common serving sizes with calories for each. |
| `photos` | Food photos shown on the page. |
| `related` | Related foods linked from the page. |
| `country` | FatSecret country site used for the row. |
| `source` | Generic foods, USDA, or a brand listing. |

### 📋 Input reference

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `input_url` | string | No | — | FatSecret food page, search, or A–Z list URL. Overrides every filter. |
| `query` | string | No | chicken | Same as the site search box. Leave empty to browse A–Z. |
| `country` | string enum | No | United States | Which country site to search. |
| `browse_set` | string enum | No | All search | Used when keyword is empty: all sets, generic foods, USDA, or brands. |
| `max_results` | integer | No | `50` | Maximum rows (`1`–`2000`). |

# Actor input Schema

## `input_url` (type: `string`):

Paste a FatSecret food page, search, or A–Z food list URL. Overrides every filter when set.

## `query` (type: `string`):

Same as the FatSecret search box. Leave empty to browse foods A–Z instead.

## `country` (type: `string`):

Which FatSecret country site to search, same country switcher as the site.

## `browse_set` (type: `string`):

Used when Keyword is empty. Pick generic foods, USDA, brands, or walk all three A–Z.

## `max_results` (type: `integer`):

How many rows to return (1–2000).

## Actor input object example

```json
{
  "query": "chicken",
  "country": "us",
  "browse_set": "search",
  "max_results": 50
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view of scraped foods using the dataset 'overview' view.

## `results` (type: `string`):

All scraped foods from the default dataset without view transformation.

# 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("dadhalfdev/fatsecret-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("dadhalfdev/fatsecret-scraper").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 '{}' |
apify call dadhalfdev/fatsecret-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dadhalfdev/fatsecret-scraper"
        }
    }
}
```

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/GduKsNEoqZml6qz3W/builds/EWcz87LtSOgKPUqLP/openapi.json
