lok0613 / alchemyapi
AlchempyApi PHP Wrapper
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/lok0613/alchemyapi
Requires
- php: ^5.3.3 || ^7.0
- guzzlehttp/guzzle: ^6.2
This package is not auto-updated.
Last update: 2025-12-01 21:50:01 UTC
README
For example, in order to get the result for "Emotion Analysis", http://www.ibm.com/watson/developercloud/alchemy-language/api/v1/?curl#emotion_analysis. Select the input type, then you can find these at right hand side.
POST /text/TextGetEmotion
Implementation as below,
use Lok0613\AlchemyApi\AlchemyApi; $alchemyApi = new AlchemyApi('api-key'); $res = $alchemyApi->getEmotion('text', [ 'text' => 'I go to school by bus', ]);
the return will be,
{
"status": "OK",
"usage": "By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html",
"totalTransactions": "1",
"language": "english",
"docEmotions": {
"anger": "0.196838",
"disgust": "0.088342",
"fear": "0.491799",
"joy": "0.069452",
"sadness": "0.222289"
}
}