https://github.com/douglasgusson/google-merchant-feed
A simple library to generate Google Merchant XML Feed
https://github.com/douglasgusson/google-merchant-feed
feed generator google-merchant xml
Last synced: 4 months ago
JSON representation
A simple library to generate Google Merchant XML Feed
- Host: GitHub
- URL: https://github.com/douglasgusson/google-merchant-feed
- Owner: douglasgusson
- License: mit
- Created: 2023-10-11T20:01:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-28T09:59:17.000Z (5 months ago)
- Last Synced: 2026-01-28T11:06:35.026Z (5 months ago)
- Topics: feed, generator, google-merchant, xml
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/google-merchant-feed
- Size: 59.6 KB
- Stars: 2
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Google Merchant Feed 🛍️
A simple library to generate Google Merchant XML Feed
[](https://badge.fury.io/js/google-merchant-feed)

[](https://opensource.org/licenses/MIT)
[](https://www.npmjs.com/package/google-merchant-feed)
## Installation
```bash
npm install google-merchant-feed
```
## Usage
```typescript
import { FeedBuilder } from "google-merchant-feed";
const feedBuilder = new FeedBuilder();
feedBuilder.withTitle("Test Store");
feedBuilder.withLink("https://example.com");
feedBuilder.withDescription("An example item from the feed");
feedBuilder.withProduct({
id: "DB_1",
title: "Dog Bowl In Blue",
description: "Solid plastic Dog Bowl in marine blue color",
link: "http://www.example.com/bowls/db-1.html",
imageLink: "http://images.example.com/DB_1.png",
availability: "in_stock",
price: {
currency: "GBP",
value: 9.99,
},
shipping: {
country: "UK",
service: "Standard",
price: {
currency: "GBP",
value: 4.95,
},
},
googleProductCategory: "Animals > Pet Supplies",
customLabels: ["Made in Waterford, IE"],
// Other fields
});
// More products
feedBuilder.withProduct({
// ...
});
const xml = feedBuilder.buildXml();
console.log(xml);
```
### Example
XML generated by the code above:
```xml
Test Store
https://example.com
An example item from the feed
DB_1
Dog Bowl In Blue
Solid plastic Dog Bowl in marine blue color
http://www.example.com/bowls/db-1.html
http://images.example.com/DB_1.png
in_stock
9.99 GBP
Animals > Pet Supplies
Made in Waterford, IE
UK
Standard
4.95 GBP
```