A Claude Code plugin for selling items on Blocket, the Swedish online marketplace. Analyzes item photos, researches fair market pricing, generates optimized ad copy in English, and automates listing creation via browser automation.
- Image Analysis: Upload photos and get automatic item identification (brand, model, condition)
- Market Research: Automatically searches Tradera for comparable listings and general web for retail pricing
- Smart Pricing: Provides low/recommended/high price estimates based on Tradera auction data and retail context
- Ad Generation: Creates compelling, honest ad copy following Blocket best practices
- Category Matching: Suggests appropriate Blocket categories from the complete category hierarchy
- Browser Automation: Uses Playwright to fill in and submit the Blocket form automatically
- Two Modes: Post mode (browser automation) or Copy mode (clipboard only)
- Claude Code (latest version)
- Python 3.8+
- Playwright (for browser automation)
- macOS/Linux (uses
pbcopyfor clipboard operations)
Copy the plugin to your Claude Code plugins directory:
cp -r blocket ~/.claude/plugins/Or use it as a project-specific plugin:
cp -r blocket /path/to/your/project/.claude-plugin/The plugin requires Playwright for browser automation:
cd ~/.claude/plugins/blocket
python3 -m venv .venv
.venv/bin/pip install -r scripts/requirements.txt
.venv/bin/playwright install chromiumNote: The virtual environment must be at blocket/.venv/ as the scripts reference this path.
On first run, the Playwright script will open a browser and prompt you to log in to Blocket:
- Log in via email + code, or BankID
- The session will be saved to
~/.blocket-session/for future use - You won't need to log in again unless the session expires
To save time on repeat listings, create .claude/blocket.local.md in your project directory:
---
# Your Blocket seller profile
postnummer: "12345"
location: "Stockholm"
# Preferences
auto_copy_mode: false
language: "en"
# Optional defaults (leave empty to be asked each time)
default_condition: ""
default_delivery: ""
---
# Blocket User Settings
Your saved preferences for Blocket listings.Template: Copy from skills/blocket-sell/examples/blocket-settings-template.md
Important: This file is gitignored by default (.claude/*.local.md) and contains your personal data. Do not commit it to version control.
- postnummer: Your Swedish postal code (required for all Blocket ads)
- location: Your city/neighborhood (improves ad visibility)
- auto_copy_mode:
trueto default to copy mode,falseto use browser posting - language:
"en"for English ads,"sv"for Swedish ads - default_condition: Pre-fill condition field (e.g., "good", "very good", "like new")
- default_delivery: Pre-fill delivery options (e.g., "pickup only", "shipping available")
The skill will automatically load these settings and only ask for missing information. After your first listing, the skill will offer to create this file for you.
Simply describe what you want to sell or provide photos:
"I want to sell this camera" [attach photo]
"Sell my old synthesizer on Blocket" [attach photos]
"List this IKEA bookshelf on Blocket"
The skill will guide you through the complete workflow:
- Analyze item photos
- Research market pricing
- Generate ad copy
- Offer refinements
- Post to Blocket (or copy to clipboard)
For direct access with options:
Default mode (browser automation):
/sell [image path or description]
Copy mode (clipboard only, no browser):
/sell --copy [image path or description]
Examples:
/sell ~/Desktop/camera.jpg
/sell --copy "Fujifilm X-T4 with lens"
/sell
If you don't provide an image or description, the skill will ask you to drag and drop photos.
-
Item Identification
- Analyzes uploaded photos to identify brand, model, condition
- Extracts visible details like color, size, accessories
- Asks for information not visible in photos (postnummer, hidden defects)
-
Market Research
- Fetches Tradera auction listings for comparable used prices
- Searches for retail prices from official sources
- Compiles pricing tiers: low/recommended/high based on market data
-
Category Selection
- Matches item against Blocket's category hierarchy
- Suggests appropriate category path
- Allows user override if needed
-
Ad Generation
- Writes compelling title (max 60 characters)
- Creates detailed description in English (100-300 words)
- Includes new retail price for context
- Adds pickup/shipping logistics
-
Listing Refinement
- Presents complete ad for review
- Allows price, description, or category changes
- Iterates until user is satisfied
-
Publishing
- Post mode: Runs Playwright script to open browser, fill form, pause for review
- Copy mode: Copies listing text to clipboard, provides Blocket URL
The Playwright script (scripts/post_to_blocket.py):
- Opens Chromium with saved session from
~/.blocket-session/ - Navigates to Blocket's ad creation form
- Selects "Torget" (marketplace) ad type
- Fills in category dropdowns based on listing JSON
- Populates title, price, description, postnummer
- Uploads images
- Pauses for user review (does NOT auto-submit)
- Keeps browser open for 5 minutes for manual review and publishing
Security: The script never auto-submits. You always review and publish manually.
Check the weight field before publishing:
- Blocket's form defaults to "5 kg eller mindre" (5kg or less) for most categories
- The automation script does NOT set the weight field
- You must manually verify and adjust the weight during the review step
- This is especially important for heavy items (furniture, appliances, etc.)
blocket/
├── .claude-plugin/
│ └── plugin.json # Plugin manifest
├── .venv/ # Python virtual environment (created during setup)
├── commands/
│ └── sell.md # /sell command definition
├── skills/
│ └── blocket-sell/
│ ├── SKILL.md # Main skill instructions
│ └── references/
│ ├── ad-writing-guide.md # Ad copywriting best practices
│ ├── blocket-categories.md # Complete category hierarchy
│ └── blocket-automation-challenges.md # Technical notes
├── scripts/
│ ├── post_to_blocket.py # Playwright automation script
│ └── requirements.txt # Python dependencies
├── blocket.local.md # Your personal settings (gitignored)
├── .gitignore # Excludes .venv, .local.md, session data
└── README.md # This file
"SingletonLock" error:
rm -rf ~/.blocket-session/SingletonLockSession expired / login required:
- Delete session data:
rm -rf ~/.blocket-session/ - Run the script again and log in fresh
Form fields not filling correctly:
- Check that your listing JSON has all required fields
- Blocket may have changed their form structure; check
scripts/post_to_blocket.pyselectors - Use
--copymode as fallback to paste manually
"No module named playwright":
cd ~/.claude/plugins/blocket
.venv/bin/pip install -r scripts/requirements.txt
.venv/bin/playwright install chromiumWrong Python version:
- Ensure Python 3.8+ is installed
- Recreate venv:
rm -rf .venv && python3 -m venv .venv
"Insufficient search results":
- The skill will still generate a listing, but may not have pricing data
- Manually research comparable items and override the suggested price
- Some niche items may not have recent Blocket/Tradera listings
- Browser session:
~/.blocket-session/contains your Blocket login session (cookies, auth tokens) - Personal settings:
blocket.local.mdcontains your postnummer and preferences - Temporary files:
/tmp/blocket_listing.jsoncontains listing data during posting
The .gitignore excludes:
.venv/(Python virtual environment)*.local.md(personal settings).blocket-session/(login session)/tmp/(temporary listing files)
If you fork this plugin, ensure you:
- Do NOT commit
blocket.local.mdwith your personal postnummer - Do NOT commit
.blocket-session/directory - Review
.gitignorebefore pushing
The plugin manifest uses a generic author placeholder. Update it with your own info if publishing.
Edit skills/blocket-sell/references/blocket-categories.md to add new categories or adjust the hierarchy as Blocket updates their system.
Edit skills/blocket-sell/references/ad-writing-guide.md to adjust:
- Tone and style preferences
- Description structure
- Common phrases
- Condition terminology
The script at scripts/post_to_blocket.py can be modified to:
- Change browser viewport size
- Adjust timeout durations
- Add additional form field mappings
- Support different Blocket form variations
Contributions welcome! Areas for improvement:
- Support for additional marketplaces (Facebook Marketplace, Marketplace by Schibsted)
- Multi-language ad generation (Swedish, Norwegian, Finnish)
- Automated price tracking and repricing
- Integration with shipping providers
- Enhanced image editing and optimization
MIT License - See LICENSE file for details
Built with:
- Claude Code by Anthropic
- Playwright for browser automation
- Blocket.se category data and best practices
Need Help? Open an issue or check the troubleshooting section above.