PHPackages                             arzzen/openai-product-feed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. arzzen/openai-product-feed

ActiveLibrary[API Development](/categories/api)

arzzen/openai-product-feed
==========================

PHP package to generate OpenAI Product Feed (JSON/CSV/XML) compliant with the Product Feed Spec

1.0.0(7mo ago)14MITPHPPHP &gt;=7.4

Since Oct 1Pushed 7mo agoCompare

[ Source](https://github.com/arzzen/openai-product-feed)[ Packagist](https://packagist.org/packages/arzzen/openai-product-feed)[ RSS](/packages/arzzen-openai-product-feed/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

OpenAI Product Feed PHP
=======================

[](#openai-product-feed-php)

This package generates Product Feeds compliant with the OpenAI Product Feed Spec:

It supports exporting in multiple formats:

- **JSON** (with `feed_id`, `feed_version`, `generated_at`)
- **CSV** (flattened structure)
- **XML**

Installation
------------

[](#installation)

You can install this library by using \[Composer\]. You can also view more info about this on \[Packagist\].

Add this to the require section in your composer.json file.

```
{
    "require": {
        "arzzen/openai-product-feed": "^1.0"
    }
}
```

Usage
-----

[](#usage)

*Command Line Usage:*

The package also includes a CLI script:

```
php bin/generate-feed.php --input=examples/products.json --format=json --output=feed.json
php bin/generate-feed.php --input=examples/products.csv --format=csv  > feed.csv
php bin/generate-feed.php --input=examples/products.json --format=xml  > feed.xml

```

*Or via PHP code:*

```
require 'vendor/autoload.php';

use OpenAI\Feed\FeedGenerator;

// Feed metadata
$fg = new FeedGenerator([
    'feed_id' => 'example_store_feed_2025_09',
    'feed_version' => '1.0',
    'generated_at' => gmdate('c'),
]);

// Example $data array for a single product
$data = [
    "id" => "SKU-TRAIL-SHOE-BLK-10",
    "item_group_id" => "SHOE-TRAIL-2025",
    "item_group_title" => "Men's Trail Running Shoes",
    "gtin" => "0123456789012",
    "mpn" => "TRAIL-2025",
    "title" => "Men's Trail Running Shoes — Black / Size 10",
    "description" => "Lightweight waterproof trail running shoes with cushioned midsole and aggressive outsole for rocky terrain. Breathable mesh upper with reinforced toe cap.",
    "link" => "https://example-store.com/product/trail-shoe",
    "image_link" => "https://example-store.com/images/trail-shoe-black-10.jpg",
    "additional_image_link" => [
        "https://example-store.com/images/trail-shoe-black-10-side.jpg",
        "https://example-store.com/images/trail-shoe-black-10-sole.jpg"
    ],
    "brand" => "ExampleBrand",
    "product_category" => "Apparel & Accessories > Shoes",
    "condition" => "new",
    "material" => "Synthetic mesh / Rubber outsole",
    "weight" => "1.2 lb",
    "color" => "Black",
    "size" => "10",
    "size_system" => "US",
    "gender" => "male",
    "price" => "129.99 USD",
    "sale_price" => "99.99 USD",
    "sale_price_effective_date" => "2025-10-01/2025-10-07",
    "applicable_taxes_fees" => "0.00 USD",
    "availability" => "in_stock",
    "inventory_quantity" => 42,
    "shipping" => [
        "US:CA:Standard:7.00 USD",
        "US:ALL:Express:16.00 USD"
    ],
    "delivery_estimate" => "2025-10-03",
    "seller_name" => "Example Store",
    "seller_url" => "https://example-store.com/store/example-store",
    "seller_privacy_policy" => "https://example-store.com/privacy",
    "seller_tos" => "https://example-store.com/terms",
    "return_policy" => "https://example-store.com/returns",
    "return_window" => 30,
    "enable_search" => "true",
    "enable_checkout" => "true",
    "offer_id" => "SKU-TRAIL-SHOE-BLK-10|ExampleStore|129.99",
    "offer_type" => "standard"
];

// Add product to feed (you can use in iteration)
$fg->addProductFromArray($data);

// Export feed as array
print_r($fg->toArray());

// Export feed in JSON
echo $fg->toJson();

// Export feed in CSV
echo $fg->toCsv();

// Export feed in XML
echo $fg->toXml();
```

#### Notes

[](#notes)

- Minimum PHP version: 7.4 (works with PHP 8.x as well).
- Required fields are validated before export (e.g., `id`, `title`, `price`, `availability`, `enable_search`).
- Supports multiple product entries in a single feed.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance63

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

223d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ac9bdd7b00d31612964e78d32fde2b346252671da0706c9ff3bc797e5e647b9?d=identicon)[arzzen](/maintainers/arzzen)

---

Top Contributors

[![arzzen](https://avatars.githubusercontent.com/u/6382002?v=4)](https://github.com/arzzen "arzzen (4 commits)")

---

Tags

feedopenapiopenapi-feedopenapi-product-feedproduct-feed

### Embed Badge

![Health badge](/badges/arzzen-openai-product-feed/health.svg)

```
[![Health](https://phpackages.com/badges/arzzen-openai-product-feed/health.svg)](https://phpackages.com/packages/arzzen-openai-product-feed)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[myoutdeskllc/salesforce-php

salesforce library for php8+

1560.8k](/packages/myoutdeskllc-salesforce-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
