PHPackages                             devkind/writesonic-php - 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. devkind/writesonic-php

ActiveLibrary[API Development](/categories/api)

devkind/writesonic-php
======================

v1.1(3y ago)328MITPHPPHP ^7.4|^8.0

Since Oct 22Pushed 3y ago2 watchersCompare

[ Source](https://github.com/devkindhq/writesonic-php)[ Packagist](https://packagist.org/packages/devkind/writesonic-php)[ Docs](https://github.com/devkind/writesonic-php)[ RSS](/packages/devkind-writesonic-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

PHP client to communicate with WriteSonic API
=============================================

[](#php-client-to-communicate-with-writesonic-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5774aad9ba0b48a024082d9d391fcafc185451bf1c2c563caac7dd2ccde93deb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766b696e642f7772697465736f6e69632d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devkind/writesonic-php)[![Total Downloads](https://camo.githubusercontent.com/f6da7c7b971e4a28ff15adffbdfc12502d05044a14f53dc9427af17be09bb579/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465766b696e642f7772697465736f6e69632d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devkindhq/writesonic-php)[![GitHub Actions](https://github.com/devkind-au/writesonic-php/actions/workflows/main.yml/badge.svg)](https://github.com/devkind-au/writesonic-php/actions/workflows/main.yml/badge.svg)

WritesonicPhp is a simple SDK implementation of Writesonic API. It helps accessing the API in an object oriented way.

### Getting the API key

[](#getting-the-api-key)

please register an account and request an api key at [Writesonic](https://writesonic.com).
 Please check out the tutorials section for more information

- [Find your API key](https://writesonic.com/api)

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

[](#installation)

You can install the package via composer:

```
composer require devkind/writesonic-php
```

Usage
-----

[](#usage)

### Initialization:

[](#initialization)

```
use Devkind\WritesonicPhp;

/** @var \Devkind\WritesonicPhp */
$writesonic  =  new WritesonicPhp(API_KEY);
```

alternatively we can initialize static

```
/** @var \Devkind\WritesonicPhp */
$writesonic  =  \Devkind\WritesonicPhp::make(API_KEY);
```

Endpoint:
---------

[](#endpoint)

Endpoints are basically the type of content that is supported by Writesonic.

Each endpoint requireds an `$engine` and `$language` parameter to query from writesonic.

```
    /** @var string $language */
    protected $language = 'en';

    /** @var string $engine */
    protected $engine = 'economy';

```

it supports following engines :

> economy, business

and it supports following languages :

> en, nl, fr, de, it, pl, es, pt-pt, pt-br, ru, ja, zh, bg, cs, da, el, hu, lt, lv, ro, sk, sl, sv, fi, et

in order to change the language or engine we can call the setter methods, which is available on all the endpoints.

to set the language

```
/** @var \Devkind\WritesonicPhp\Endpoints\GenerateImage */
$endpoint = $writesonic->GenerateImage->setLanguage('br');
```

to set the engine

```
/** @var \Devkind\WritesonicPhp\Endpoints\GenerateImage */
$endpoint = $writesonic->GenerateImage->setEngine('business');
```

alternatively:

```
/** @var \Devkind\WritesonicPhp\Endpoints\GenerateImage */
$endpoint = $writesonic->GenerateImage->setEngine('br')->setLanguage('br');
```

### Supported Objects / Endpoints and Usage detail:

[](#supported-objects--endpoints-and-usage-detail)

All the endpoints can be called into three different ways

#### as a payload

[](#as-a-payload)

```
$object  =  new WritesonicPhp('test123');
/** @var \Devkind\WritesonicPhp\Endpoints\GoogleAds */
$endpoint = $object->GoogleAds;

$array = $endpoint->setPayload([
    "product_name" => 'test',
    "product_description" => 'test',
    "search_term" => 'test',
])->get();
```

#### through the setter methods

[](#through-the-setter-methods)

```
$object  =  new WritesonicPhp('test123');
/** @var \Devkind\WritesonicPhp\Endpoints\GoogleAds */
$endpoint = $object->GoogleAds;
/** @var array */
$array = $endpoint->setProductName('test')
    ->setProductDescription('test')
    ->setSearchTerm('test')
    ->get();
```

#### through the `generate` method

[](#through-the-generate-method)

```
/** @var \Devkind\WritesonicPhp\Endpoints\GoogleAds */
$endpoint = $writesonic->GoogleAds;
/** @var array */
$endpoint->generate(
	$product_name,
	$product_description,
	$search_term
);
```

#### through the `get` method

[](#through-the-get-method)

```
/** @var array */
$endpoint = $writesonic->GoogleAds->get([
    "product_name" => 'test',
    "product_description" => 'test',
    "search_term" => 'test',
]);
```

##### [Click here ](https://github.com/devkindhq/writesonic-php/blob/main/endpoints.md) to view the entire documentation of supported endpoints

[](#click-here--to-view-the-entire-documentation-of-supported-endpoints)

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Devkind Developer](https://github.com/devkindhq)
- [Devkind Developer](https://devkind.com.au/)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60.6% 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

Every ~20 days

Total

2

Last Release

1283d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7828ff29033f88e33044a6606e46c6f729ad1729914a4efd4c3b2086ef91094c?d=identicon)[devkind](/maintainers/devkind)

---

Top Contributors

[![saad-bhutto](https://avatars.githubusercontent.com/u/5573883?v=4)](https://github.com/saad-bhutto "saad-bhutto (20 commits)")[![saad-devkind](https://avatars.githubusercontent.com/u/69035117?v=4)](https://github.com/saad-devkind "saad-devkind (9 commits)")[![devkind-au](https://avatars.githubusercontent.com/u/115474122?v=4)](https://github.com/devkind-au "devkind-au (3 commits)")[![saad-aroflo](https://avatars.githubusercontent.com/u/125532686?v=4)](https://github.com/saad-aroflo "saad-aroflo (1 commits)")

---

Tags

apidevkindwritesonic-php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/devkind-writesonic-php/health.svg)

```
[![Health](https://phpackages.com/badges/devkind-writesonic-php/health.svg)](https://phpackages.com/packages/devkind-writesonic-php)
```

###  Alternatives

[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M468](/packages/saloonphp-saloon)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M24](/packages/php-opencloud-openstack)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[bushlanov-dev/max-bot-api-client-php

Max Bot API Client library

281.6k](/packages/bushlanov-dev-max-bot-api-client-php)

PHPackages © 2026

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