4pricing documentation: API and MCP server
Everything you need to connect 4pricing to your own systems or to an AI assistant: the REST API, the MCP server, the technologies they are built on and the connection steps.
At a glance
4pricing offers two ways to integrate. Both use the same API key and the same data from your account.
REST API
For developers and integrations: read your compared products, competitor prices and alerts, send your own prices and receive signed webhooks.
MCP server
For AI assistants: Claude, Cursor, VS Code and other MCP-compatible apps can read and update your 4pricing data through tools, in plain language.
One key
You create the key in the panel, under “API & keys”. The same key works for the API and for MCP, and your plan's limits and credits apply in the same way.
Technologies used
The standard technologies the API, the MCP server and the platform are built on:
| Technology | What we use it for |
|---|---|
| REST · JSON · HTTPS | Every request and response is JSON over HTTPS, with the usual HTTP methods: GET, POST, PUT, PATCH, DELETE. |
| OpenAPI 3.1 | A public, machine-readable specification you can generate a client from, in the language of your choice. |
| API keys · SHA-256 | API keys start with prc_live_. We keep only their SHA-256 fingerprint, and the full key is shown to you once. |
| Webhooks · HMAC-SHA256 | Notifications sent to your server are signed with HMAC-SHA256, so you can check that they come from 4pricing. |
| Model Context Protocol · Streamable HTTP · JSON-RPC 2.0 | The open standard AI assistants use to call external tools. Our server is stateless: every request is authenticated on its own. |
| Python · FastAPI · FastMCP | The API and MCP services are written in Python with FastAPI / FastMCP. |
| PostgreSQL | Your account data is stored in a PostgreSQL database, kept separate per account. |
| Next.js · React · TypeScript | The website and the dashboard are built with Next.js, React and TypeScript. |
| Docker · TLS | The services run in Docker containers, and all public traffic is encrypted with TLS. |
REST API
The API gives you programmatic access to the same data you see in the dashboard.
- Authenticate with the X-API-Key header, or with Authorization: Bearer, followed by your prc_live_ key.
- Access requires an active 4pricing subscription; without one you get 402 plan_required.
- The limit is 60 requests per minute for the whole account, not per key.
- Searches and on-demand price checks use credits from your plan; reads and your own prices are free.
First call: list your compared products
bash
curl -s https://4pricing.net/api/v1/pricing/groups/ \
-H "X-API-Key: prc_live_…"All 50+ operations, the error codes, the webhooks and examples in PHP, Node.js and Python are in the full reference.
MCP server
The 4pricing MCP server lets an AI assistant work directly with your data: ask “where am I more expensive than my competitors?” and the assistant reads the answer from your account.
- The server address is https://4pricing.net/mcp, over the Streamable HTTP transport.
- You authenticate with the same API key, sent in the Authorization: Bearer header.
- Every tool calls the 4pricing API, so the limits, the subscription and the credits are the same as for the API.
- Deletes, settings, API keys and writing prices to your shop are not available through MCP.
Connecting the MCP server
First create an API key in the dashboard, then add it to your app. Replace prc_live_… with your key.
Claude Code
Run the command in your terminal:
bash
claude mcp add --transport http 4pricing https://4pricing.net/mcp \
--header "Authorization: Bearer prc_live_…"Cursor
Add the server to your MCP configuration file:
json~/.cursor/mcp.json
{
"mcpServers": {
"4pricing": {
"url": "https://4pricing.net/mcp",
"headers": {
"Authorization": "Bearer prc_live_…"
}
}
}
}VS Code
Add the server to the project's MCP configuration; you are asked for the key when it starts:
json.vscode/mcp.json
{
"servers": {
"4pricing": {
"type": "http",
"url": "https://4pricing.net/mcp",
"headers": {
"Authorization": "Bearer ${input:pricingKey}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "pricingKey",
"description": "4pricing API key",
"password": true
}
]
}Quick test from the terminal
Check the connection by asking for the list of tools:
bash
curl -s https://4pricing.net/mcp \
-H "Authorization: Bearer prc_live_…" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'MCP tools
The server exposes 20 tools. Amounts are integers in minor units of the account currency (99.90 becomes 9990).
Read
They change nothing and use no credits.
| Tool | What it does |
|---|---|
| list_products | Your compared products, with your price, the lowest competitor price, the gap and the recommended price. |
| get_product_comparison | One product's position against each competitor: prices, stock and the reason for the recommended price. |
| list_links | The tracked links (yours and your competitors'), with the latest price and the time of the last check. |
| get_link_history | The price history of one tracked link, newest check first. |
| list_price_changes | The links whose price changed at their latest check. |
| list_alerts | Your alert rules and how many times each one fired. |
| list_alert_events | The alerts that fired, newest first. |
| list_insights | The system's findings: margin headroom, competitors out of stock, price wars. |
| get_opportunities | The number and estimated monthly value of the open opportunities. |
| get_latest_briefing | The latest daily summary of your market. |
| get_credits | The credits left in your account. |
| get_plan_limits | Your plan limits: tracked links, competitors per product, minimum check interval. |
| get_capabilities | What 4pricing covers: stores readable by link, countries with search by name, market scan and public plans. |
Write
They create or change records in 4pricing. They read no pages and use no credits.
| Tool | What it does |
|---|---|
| create_product | Create a product to compare, with your price and cost. |
| update_product | Change a product's details or your price recorded in 4pricing. |
| create_alert | Create an alert rule on a link or on a product. |
| push_own_price | Send your price for a product from your own catalogue, with no credits used. |
Use credits
| Tool | What it does |
|---|---|
| add_competitor_link | Add a competitor's link to a product and check its price straight away. |
| refresh_product_prices | Check again, now, the prices of every link of a product. |
| search_products | Search offers by a product link or, on the markets where search is available, by keyword. |
Security and limits
- The API key gives access to all of your account's data: do not put it in public code and do not send it by e-mail.
- A key revoked in the dashboard stops working immediately, on the API and on MCP.
- The MCP server does not store your key and cannot reach other accounts: every call goes through the same checks as a direct API call.
- The limit of 60 requests per minute is shared by the API and MCP; above it you get 429 with a Retry-After header.
- Tool results are capped at 50 rows; for large volumes use the API with paging.
Frequently asked questions
What is the 4pricing MCP server?
It is a Model Context Protocol server at https://4pricing.net/mcp that lets an AI assistant such as Claude read the compared products, competitor prices and alerts in your account, and create new products or alerts.
Do I need a subscription to use the API or MCP?
Yes. The API and the MCP server are included in every active 4pricing subscription. You create the key in the dashboard, under “API & keys”.
Does using MCP use credits?
Only the tools that start a price check or a search: add_competitor_link, refresh_product_prices and search_products. Reads, products, alerts and your own prices use no credits.
Which apps can use the 4pricing MCP server?
Any MCP client that supports the Streamable HTTP transport and authentication headers, for example Claude Code, Cursor or VS Code.
Can I change the prices in my shop through MCP?
No. Through MCP you can record your price in 4pricing, but you cannot write prices to your shop.