=== KDPTop Widgets: Amazon Book Best Sellers & Sales Rank ===
Contributors: kdptop
Tags: amazon, books, kdp, best sellers, self-publishing
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Live Amazon book data for your posts: a category's Best Sellers, a book's current rank, and a sales-rank-to-sales calculator.

== Description ==

KDPTop Widgets puts live Amazon.com book data into your posts and pages. The numbers refresh every day on their own, so an article about a book niche does not go stale.

**Five widgets**

* **Category Best Sellers**: the top 3 to 10 books of any Amazon Books or Kindle Store category, with covers.
* **Category market snapshot**: median price, median ratings per book, share of new releases and an opportunity score for a category.
* **Book rank card**: one book's cover and its best current Best Sellers position.
* **Book rank badge**: the same as a small image, for sidebars and author pages.
* **Sales rank to sales calculator**: visitors enter an Amazon Best Sellers Rank and see estimated copies sold a day and a month.

**Who it is for**

* Authors who want to show where their book ranks today.
* Bloggers and newsletter writers covering self-publishing, Amazon KDP or book niches.
* Book review and book deal sites.

**How to use it**

Add the **KDPTop Widget** block, or a shortcode:

`[kdptop widget="category-top" node="7538396011" limit="5"]`
`[kdptop widget="category-stats" node="7538396011"]`
`[kdptop widget="book-rank" asin="B0CRQHRDK1"]`
`[kdptop widget="badge" asin="B0CRQHRDK1"]`
`[kdptop widget="calculator"]`

Shortcode attributes: `widget`, `node` (Amazon category id), `asin`, `limit` (3 to 10), `theme` (`light` or `dark`), `tag` (your Amazon Associates tag), `bsr` (starting rank for the calculator).

The widgets are drawn in their own container, so your theme's styles do not change them. No account or API key is needed.

**Amazon Associates**

Enter your own Associates tag under Settings > KDPTop Widgets and the Amazon links in the widgets carry it. Those links are marked `rel="sponsored nofollow"`.

**No credit link unless you turn it on**

By default the widgets carry no link to KDPTop. A "Data by KDPTop" line can be switched on under Settings > KDPTop Widgets.

== External services ==

This plugin shows data from KDPTop (https://kdptop.com), a service that tracks Amazon book lists. It cannot work without it.

* **What is requested and when.** When a visitor opens a page that has a widget, their browser asks `https://kdptop.com/api/public/embed/` for that widget's data (the category id or ASIN you chose; for the calculator, the rank, format and price the visitor typed). Book covers are loaded from `https://kdptop.com/cover/`. The badge is an image loaded from `https://kdptop.com/badge/`. If you turn the credit link on, your server asks the same address once a day per widget for the address of the matching page on KDPTop.
* **What is sent.** The category id or ASIN, and what every web request carries: the visitor's IP address, browser user agent and the address of the page the widget is on (the Referer header). No cookies are set or read, and nothing about your visitors or your WordPress users is collected by the plugin.
* **What KDPTop keeps.** The host name of the site a widget is shown on and a count of requests, to see where widgets are used and to limit abuse.

Service terms: https://kdptop.com/terms
Privacy policy: https://kdptop.com/privacy

The widget script itself ships with the plugin (`assets/widgets.js`); no code is loaded from another server.

Amazon is a trademark of Amazon.com, Inc. KDPTop is not affiliated with Amazon. Sales figures are estimates worked out from sales rank.

== Installation ==

1. Upload the `kdptop-widgets` folder to `/wp-content/plugins/`, or install the zip under Plugins > Add New > Upload Plugin.
2. Activate the plugin.
3. Add the KDPTop Widget block to a post, or paste a shortcode.
4. Optional: Settings > KDPTop Widgets for your Amazon Associates tag and the credit link.

== Frequently Asked Questions ==

= Where do I find a category id? =

It is the number at the end of the address of an Amazon Best Sellers page, for example `7538396011` in `amazon.com/gp/bestsellers/books/7538396011`. The widget builder at kdptop.com/widgets finds it by category name.

= Do I need a KDPTop account? =

No. The widgets are free and need no key.

= Which Amazon store is covered? =

Amazon.com (United States), print books and Kindle eBooks.

= How fresh is the data? =

Lists are read once a day. Each widget shows the date of its data.

= Will it slow my site down? =

The script is about 15 KB, loads deferred in the footer and only on pages that have a widget. Covers load lazily.

= Are the sales numbers real? =

They are estimates worked out from Amazon's Best Sellers Rank, not figures reported by Amazon or publishers.

== Screenshots ==

1. Category Best Sellers, market snapshot, book rank card and calculator in a post.
2. The KDPTop Widget block and its settings in the editor.
3. Settings > KDPTop Widgets.

== Changelog ==

= 1.0.0 =
* First release: five widgets, shortcode and block.

== Upgrade Notice ==

= 1.0.0 =
First release.
