Linux 软件免费装
Banner图

MetalflowAPI — Live Precious Metals Prices

开发者 qeras89
更新时间 2026年10月2日 22:26
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

precious metals jewelry gold price silver price gold api

下载

1.0.6 1.0.7 1.0.8 1.3.0

详情介绍:

The official MetalflowAPI WordPress plugin makes it dead simple to embed live precious metals prices on any WordPress site — perfect for jewelers, publishers, trade-in calculators and bullion shops. Features Shortcodes [metalflow_price metal="Gold" currency="EUR" unit="g"] — spot price for one metal [metalflow_carat carat="14" currency="EUR" unit="g"] — carat-aware Gold price [metalflow_ticker currency="EUR" unit="g" style="minimal"] — all 4 metals [metalflow_table currency="EUR" unit="g"] — full carat table 9k–24k [metalflow_change metal="Gold" days="30"] — % change over N days (Starter and above) [metalflow_calc currency="EUR"] — interactive carat-weight calculator [metalflow_chart metal="Gold" currency="EUR" range="1y" ranges="7d,1m,6m,1y,5y,max"] — interactive history chart with range buttons (paid plans) Chart attributes Ranges longer than your plan's history (Free 30 days, Starter 5 years, Pro 30 years) are hidden from visitors; administrators see them with a lock and a link to the plans. The default range is rendered with the page; other ranges load on click from your own site (/wp-json/metalflowapi/v1/chart, which only serves charts that appear on your site, from the server-side cache). Styling attributes (all shortcodes) Example: [metalflow_ticker style="minimal" color="#b8860b"], [metalflow_chart range="1m" style="borderless" color="#2563eb" radius="12"]. Invalid values are ignored. Without attributes, widgets use Settings → MetalflowAPI → Appearance, and with that left empty they follow your theme. Pricing The plugin is 100% free. Prices come from the MetalflowAPI service, which has a free tier (no credit card required): Current plans: metalflowapi.com/pricing EU & GDPR Servers in Strasbourg (France). All data within EU. GDPR-compliant. EUR billing with VAT invoices. External services This plugin connects to the MetalflowAPI service (metalflowapi.com, operated by MetalflowAPI) to fetch precious metals prices. It is required for live data; without an API key the plugin makes no requests at all. Terms of Service: https://metalflowapi.com/legal/terms · Privacy Policy: https://metalflowapi.com/legal/privacy Price data (only after you add or register an API key). Requests are made from your WordPress server — never from your visitors' browsers — when a page with a MetalflowAPI shortcode, block or widget is rendered and the cached copy has expired, and when you click "Test connection". Endpoints: Sent with each request: your API key (X-API-Key header), the query parameters needed for the widget (metal, currency, unit, date range, chart size/colour) and a User-Agent with the plugin and WordPress version numbers (it does not contain your site address). Your server's IP address is visible to the service, as with any HTTP request. Nothing about your visitors (IP addresses, cookies, behaviour), posts, comments or users is sent. Optional in-dashboard registration (Settings → MetalflowAPI → "Get your free API key"). Only when you type your email address and click "Send code", the plugin sends that email address, this site's URL and the plugin version to https://metalflowapi.com/api/plugin/request-code. When you enter the 6-digit code it sends your email address and the code to https://metalflowapi.com/api/plugin/verify-code. This creates your free MetalflowAPI account and returns your API key, which is saved in your site's WordPress options. Optional "Powered by MetalflowAPI" bonus (off by default). Only after you tick "Show a 'Powered by MetalflowAPI' link…" in Settings → MetalflowAPI and save (or click "Register this site"), the plugin sends this site's address (home URL), the address of one public page of your site that shows a MetalflowAPI widget (if known), the plugin version and your API key (X-API-Key header) to https://metalflowapi.com/api/plugin/poweredby (POST). MetalflowAPI then loads that homepage/page — right away and about once a day — only to check that the "Prices by MetalflowAPI" link is there; on the Free plan a verified link raises your monthly limit to 2,000 requests and gives fresher prices. The settings page asks the same endpoint for the verification status (GET, at most every 10 minutes while you view the page). When you untick the option, the plugin asks the endpoint to delete the registration (DELETE). Nothing is sent while the option is off. Chart ranges in the browser. When a visitor clicks a chart range button, the browser asks your own site (/wp-json/metalflowapi/v1/chart), not metalflowapi.com. That endpoint only accepts the metal/currency/unit combinations of charts rendered on your site (signed) and the six fixed ranges, answers from the server-side cache (one API request per range per cache period: at least 30 minutes for 7D/1M, 1 hour for 6M/1Y, 6 hours for 5Y/Max) and never exposes your API key. Caching. Responses are cached on your server with WordPress transients: on the Free plan (delayed prices) for 6 hours (1 hour with an active "Powered by" bonus), on paid plans for the configured time (default 5 minutes, never shorter than the plan's own refresh interval). Errors are cached briefly (a quota error until the time given by the service), and the last successful response is kept so visitors see the last known price, with its date, while the service is unreachable. Links. Links to metalflowapi.com in the WordPress admin (sign-up, pricing, dashboard) carry utm_* parameters and the plugin version so MetalflowAPI can see which plugin version a visit came from. Nothing is sent until you click such a link. The optional "Prices by MetalflowAPI" link on the public site is off by default; when you enable it, it is a plain link to metalflowapi.com (the gold price page of your default currency) without tracking parameters, shown once per page.

安装:

  1. Upload the plugin to /wp-content/plugins/metalflowapi-live-precious-metals-prices/ or install it through the WordPress Plugins screen.
  2. Activate the plugin.
  3. Go to Settings → MetalflowAPI, enter your email to get a free key in the dashboard (or paste an existing key from metalflowapi.com/dashboard/keys).
  4. Click Test connection to verify.
  5. Drop a shortcode into any post or page, e.g. [metalflow_ticker currency="EUR"].

屏幕截图:

  • The same chart on a dark background — colours adapt automatically.
  • Administrators see ranges beyond the plan with a lock and an upgrade link; visitors never see locked buttons.
  • Style presets: card, minimal and borderless.
  • Custom accent colour via shortcode attributes.
  • Settings → MetalflowAPI → Appearance with colour pickers and live preview.
  • Block inspector: chart settings, range buttons and "Widget style" panel.
  • Carat table and carat-weight calculator.

升级注意事项:

1.3.0 Optional, off-by-default "Powered by MetalflowAPI" link that gives Free-plan sites 2,000 requests/month and fresher prices once verified; the usage box now uses the limit sent by the service. Existing shortcodes, blocks and settings keep working. 1.2.0 Interactive chart with 7D–Max range buttons and tooltips, theme-adaptive widgets and new Appearance settings (presets, colours, radius) for all widgets. Existing shortcodes, blocks and settings keep working. 1.1.2 Security and reliability update: removes a public REST proxy that could use up your API quota, keeps showing the last known prices when the API is unavailable, and hides sample data from visitors. Recommended for all users. Existing shortcodes, blocks and settings keep working. 1.1.1 Currency dropdown and unit-aware prices (per gram / kg / troy ounce). Safe upgrade — existing settings are kept. 1.0.5 Review compliance update. Safe upgrade — "Powered by" now off by default. 1.0.4 Adds the long-awaited historical chart shortcode + block. Safe upgrade. 1.0.3 Displays unit suffix (/g, /kg, /ozt) next to single-metal prices. Safe upgrade. 1.0.2 Adds auto-migration for legacy/orphan options. Safe upgrade. 1.0.0 First release.

常见问题:

Do I need a paid plan to use this plugin?

Not for a personal or non-commercial site: the Free plan (500 requests/month, delayed prices) works with the plugin, which caches Free-plan prices for 6 hours to stay within the quota. Commercial sites (shops, jewelers, dealers) need a paid plan under MetalflowAPI's terms; Starter (€9/mo) also gives fresher prices and the change widget. Settings → MetalflowAPI shows your plan and monthly usage.

What is the "Powered by MetalflowAPI" bonus?

An optional deal, off by default: tick "Show a 'Powered by MetalflowAPI' link under widgets…" in Settings → MetalflowAPI and the plugin prints one small "Prices by MetalflowAPI" link per page, under the first widget. Your site is registered with MetalflowAPI, which checks your homepage (or the first public page that shows a widget) for the link right away and then daily. While the link is found, the Free plan gets 2,000 requests/month instead of 500 and fresher prices; the settings page shows the status (pending, verified, link not found). If the link is missing on two checks in a row, the bonus ends. Paid plans can show the link too, but don't need the bonus. Untick the option to remove the link and the registration at any time.

What happens when my monthly requests run out or the API is down?

Visitors keep seeing the last known prices, labelled "as of ", and the plugin stops calling the API until the time given by the service, so pages stay fast. Administrators see a notice at 80% and 100% of the monthly quota (only on the Dashboard, Plugins and MetalflowAPI settings screens).

Where is my API key stored?

In your WordPress database (wp_options). Requests to MetalflowAPI are made from your WordPress server — the key is never sent to visitor browsers.

Does this plugin slow down my site?

No. All API responses are cached server-side via WordPress transients (default 5 min, configurable). On a cache hit, response time is essentially zero.

Can I use this in a multisite / network?

Yes. Each site has its own settings and its own API key.

Does the plugin work without an API key?

Visitors see nothing until a key is added. Logged-in editors see static sample data (labelled "Sample data · only you see this") so they can place and style widgets. The sample is built into the plugin — no network request is made and nothing is sent anywhere.

Do you support cryptocurrency prices?

Not in v1.0. BTC/ETH support is on the roadmap for the MetalflowAPI service.

Can I customize the styling?

Yes. By default the widgets follow your theme. Settings → MetalflowAPI → Appearance sets a style preset (card, minimal, borderless), colours, corner radius and text size for all widgets, with a live preview. Each block has colour, typography, spacing and border controls plus a "Widget style" panel, and every shortcode accepts style, color, text, bg, border, up, down, radius and size. For full control, the widgets use CSS custom properties on the .mfapi-w wrapper (--mfapi-accent, --mfapi-text, --mfapi-bg, --mfapi-border, --mfapi-up, --mfapi-down, --mfapi-radius) and semantic class names (mfapi-price, mfapi-ticker, mfapi-chart, …).

Why are some chart ranges missing?

Ranges longer than your plan's history are hidden from visitors (Free: 30 days — the chart itself needs a paid plan; Starter: 5 years; Pro: 30 years; Max is the full archive back to 1968). Logged-in administrators see these buttons with a lock and a link to the plans.

更新日志:

1.3.0 1.2.0 1.1.2 1.1.1 1.1.0 1.0.9 1.0.8 1.0.7 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0