Feng-GUI Platform API
Feng-GUI has an open web Application Programming Interface (API) that enables integration with Feng-GUI’s visual analytics services.
This allows organizations, data analysts and insights teams to incorporate visual analytics intelligence directly into their existing platforms and workflows.
Feng-GUI Platform API partners range from digital marketing agencies and email marketing providers to packaging design and consumer insights vendors.
Getting started
Here's how to get started:
1. Review and agree to the
API license agreement.
2. Read the API documentation below. Feel free to send us some feedback.
3. Request for an evaluation API account. email to: sales@feng-gui.com to add the 'api' role to your account
4. After you have learned how to use API, build your own application.
Roles
A Role indicates the levels of permissions a user have while operating a method.
Your account is associated with one or more Roles.
Account Roles depends on package plans and the Feng-GUI partnership level you have.
To use the API, your account must include the 'api' role.
Please contact sales@feng-gui.com and request to add the 'api' role to your account.
Your account roles may be found at
Settings > Account > Roles
Authentication
Feng-GUI services required
HTTP Basic authentication for all methods.
HTTPS/TLS must be used in conjunction with HTTP Basic authentication.
Storage
Files uploaded or generated as reports via an API account are retained on Feng-GUI servers for up to 24 hours. API users are responsible for moving these files to their own servers within that time frame and are encouraged to serve the content from their own infrastructure, not directly from Feng-GUI servers.
Data Retention: File and report availability depends on your account plan.
Uploaded files and reports are automatically deleted based on your subscription type: after 3 months for monthly subscribers, 1 year for annual subscribers.
Data Storage: Each account includes a Storage quota. Once this limit is reached, uploading new files will be disabled.
To manage your storage, you can download or delete reports at any time to free up space.
Postman Examples & API Collection
For practical examples of request syntax and hands-on testing, you may find the API documentation and collection available on Postman helpful. These resources are commonly used for learning, exploration, and validating API requests alongside this documentation
https://docs.api.feng-gui.com/
API Formats
To perform an action using the API, you need to invoke a JSON-RPC or SOAP (deprecated) request to its endpoint specifying a method and some
parameters, and will receive a formatted response.
JSON-RPC API
The Feng-GUI API is implemented using the
JSON-RPC 1.0 specification. It allows developers to programmatically access visual attention analysis tools by sending remote procedure calls over HTTPS.
For more information on the protocol standards, refer to the
JSON-RPC 1.0 Specification
Service Endpoints
| Purpose | URL |
| API Endpoint | https://service.feng-gui.com/json/api.ashx |
| Postman Examples & API Collection | https://docs.api.feng-gui.com/ |
| Quick Help | https://service.feng-gui.com/json/api.ashx?help |
| Test Page | https://service.feng-gui.com/json/api.ashx?test |
Request Fromat
The API supports two methods of communication: standard JSON-RPC via
POST JSON and a shorthand syntax via
GET URL.
POST Request (JSON)
A remote method is invoked by sending a POST request with a JSON body containing the following properties:
| Name | Type | Description |
| id | String | A unique, client-generated identifier (such as a timestamp or UUID) that enables request–response correlation. |
| method | String | The name of the specific method to be invoked. |
| params | Object | A structured object containing the parameters required by the method. |
To send a request , for example, to ImageAttention, send a request like this:
{
"id": "1768240240",
"method": "ImageAttention",
"params": {
"InputImage": "https://service.feng-gui.com/users/USERNAME/files/images/IMAGEID.png",
"ViewType": 0,
"ViewDistance": 0,
"AnalysisOptions": 0,
"OutputOptions": 0
}
}
Demo page of POST API methods
FG-JSON-GET-Demo.html
GET Request (URL)
For simplified access or quick testing via a browser, the API also supports requests via the GET method. In this format, the method name is appended to the base URL as a path, and parameters are passed as standard URL query strings.
GET URL Structure:
https://service.feng-gui.com/json/api.ashx/[METHOD]?id=[ID]&[PARAM1]=[VALUE1]&[PARAM2]=[VALUE2]
Example GET Request:
https://service.feng-gui.com/json/api.ashx/ImageAttention?id=1768240240&InputImage=https://service.feng-gui.com/users/USERNAME/files/images/IMAGEID.png&ViewType=0&ViewDistance=0&AnalysisOptions=0&OutputOptions=0
Demo page of GET API methods
FG-JSON-GET-Demo.html
Response Fromat
The service returns a JSON object with the following properties:
| Name | Type | Description |
| id | String | The unique identifier matching the original request. |
| result | Object | The data returned by the method. Returns null if an error occurred. |
| error | Object | Details regarding any failures. Returns null if successful. |
Successful Response Example:
{
"id": "1768240240",
"result": {
"serviceVersion": "8.2.4.3",
"version": "8.2.4.3",
"inputImage": "https://service.feng-gui.com/users/USERNAME/files/images/IMAGEID.png",
"outputImage": "https://service.feng-gui.com/users/USERNAME/files/images/IMAGEID_heatmap.png",
"outputAttentionImage": "https://service.feng-gui.com/users/USERNAME/files/images/IMAGEID_raw.png",
"hotspots": [
{
"x": 378,
"y": 168
},
{
"x": 251,
"y": 184
},
{
"x": 562,
"y": 385
},
{
"x": 60,
"y": 373
},
{
"x": 330,
"y": 182
},
{
"x": 483,
"y": 366
},
{
"x": 392,
"y": 120
},
{
"x": 109,
"y": 171
},
{
"x": 105,
"y": 395
},
{
"x": -1,
"y": -1
}
]
}
}
Error Response Example:
If a request fails, the error property will contain details about the exception.
{
"id": "1768324041",
"error": {
"name": "JSONRPCError",
"message": "Error Message.",
"errors": [
{
"name": "JsonRpcException",
"message": "Error Message."
}
]
}
}
JavaScript Proxy
This approach allows you to invoke remote methods as if they were local JavaScript functions.
The following example demonstrates how to initialize the API service and perform basic calls to retrieve account information and verify connectivity.
To use the Feng-GUI JavaScript client, you must include two script references:
json.js: Provides the necessary serialization logic to convert JavaScript objects into JSON-RPC compliant strings.
apiProxy.js: The Feng-GUI API proxy that abstracts the HTTP communication, allowing you to call methods (like echo or ImageAttention) directly on the api object.
All method calls via the proxy are asynchronous. The proxy follows a standard callback pattern:
Request: You call a method and provide a function as the final parameter.
Callback: Once the server responds, your function is executed.
Response Object: The callback receives a single response object containing:
** response.result: The data returned by the service (if successful).
** response.error: Details of the failure (if unsuccessful).
Security Note: For production environments, it is recommended to proxy these requests through your own backend to avoid exposing API credentials in client-side source code.
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Feng-GUI JSON-RPC Javascript example</title>
<script type="text/javascript" src="https://service.feng-gui.com/json/json.js"></script>
<script type="text/javascript" src="https://service.feng-gui.com/json/apiProxy.js"></script>
<script type="text/javascript">
window.onload = function()
{
var service1 = new api('https://service.feng-gui.com/json/api.ashx', 'username', 'password');
// echo method
service1.echo("test string",function(response) {
document.getElementById('log').innerHTML += '<br>echo:' + response.result;
});
// GetAccountInfo method
service1.GetAccountInfo("username",function(response) {
var AccountInfo = response.result;
document.getElementById('log').innerHTML += '<br>GetAccountInfo.credit:' + AccountInfo.credit;
});
}
</script>
</head>
<body>
<div id="log">output:</div>
</body>
SOAP Web Service API
SOAP API Deprecated and might be removed in a future releases. Please use JSON format.
The SOAP 1.2 service Endpoint URL is:
https://service.feng-gui.com/soap/api.asmx
SOAP service description (WSDL) is at
https://service.feng-gui.com/soap/api.asmx?wsdl
SOAP service test page is:
https://service.feng-gui.com/soap/api.asmx
echo method
A test method which echo's all parameters back in the response.
Credit: no credit is charged when using this method.
Parameters
| Name | Type | Description |
| InputString | String | input string to echo. |
Request example
{
"id": "1768240240",
"method": "echo",
"params": {
"InputString": "echo me!"
}
}
Response
The response is a string with the value of the input string to echo.
Response example
{
"id": "1768240240",
"result": "echo me!"
}
ImageUpload method
Upload an image file to your account.
The file is uploaded into the root of the account folders.
Credit: one credit is charged for a successful execution.
Method applies to image analysis.
Performance Tip: Instead of using ImageUpload method, you can upload the input image to your server and set the ImageAttention.InputImage parameter as the URL path of the image.
Parameters
| Name | Type | Description |
| FileName | String | The name of the uploaded file. The characters allowed for FileName are - a-z A-Z 0-9 The FileName will be renamed by the service to avoid non supported characters. |
| FileData | String | The uploaded file encoded as base64 byte array. |
Response
The response is a string with the new file name of the uploaded file.
ImageAttention method
Feng-GUI attention analysis of an image.
Credit: one credit is charged for an image analysis.
Method applies to image analysis.
The method generates the Heatmap, Gaze plot, Opacity, AOIs and Aesthetics reports in one execution.
| File | Path |
| Input image | https://SERVICE/users/USERNAME/files/images/ImageID.png |
| Heatmap report | https://SERVICE/users/USERNAME/files/images/ImageID_heatmap.png |
| Gaze plot report | https://SERVICE/users/USERNAME/files/images/ImageID_gazeplot.png |
| Focus Map report | https://SERVICE/users/USERNAME/files/images/ImageID_opacity.png |
| AOIs report | https://SERVICE/users/USERNAME/files/images/ImageID_aoi.png |
| Aesthetics report | https://SERVICE/users/USERNAME/files/images/ImageID_aes.png |
| Analysis information | https://SERVICE/users/USERNAME/files/images/ImageID_info.txt |
| Raw data report | https://SERVICE/users/USERNAME/files/images/ImageID_raw.png |
| Raw Visual Featurtes report | https://SERVICE/users/USERNAME/files/images/ImageID_raw_vf.png |
SERVICE: Service endpoint domain name. for example service.feng-gui.com
ImageID: The relative file name of the input image or video URL including the file extension .png or .mp4
USERNAME: Your account name.
Parameters
InputImage (string)
Full URL (http://...) path of the input image file.
ViewType (integer)
View Type sets the context of the image or video.
Learn more about
View Type at the help section.
This parameter is a value from one of the following flags.
| Name |
Value |
Description |
| Any |
0 |
Default |
| Online - Desktop |
1 |
online content viewed on Laptop or Desktop |
| Natural |
2 |
Photo, Print Ad, Print media, Natural scenes |
| Package |
3 |
Single Pack, 3D, Tangible products and packaging |
| Indoor |
4 |
Indoor Ads, Signage, Shelf, Planogram |
| Outdoor |
5 |
Outdoor Ads, Billboards |
| Online - Mobile/TV |
6 |
online content viewed on Mobile or TV Screen |
ViewDistance (integer)
Deprecated. View distance is determined automatically by View Type.
View Distance defines the viewer’s distance to the image or video, which in turn determines the visual angle and the spatial extent of gaze data.
| Name |
Value |
Description |
| Any |
0 |
Default. View distance is determined automatically by View Type |
AnalysisOptions (integer)
Specifies the sub algorithms used in the analysis. This parameter is a combination
of accumulated flags from the following group of flags.
For example, to include all the basic visual features (63) and AnalyzeFace (128), set the AnalysisOptions = 63 + 128 = 191
| Name |
Value
|
Description
|
| Default |
0 |
Basic Visual Features analysis.
|
| Extended Visual Features |
15 (1+2+4+8) |
Extended Visual Features analysis. A collection of bottom-up and top-down cognitive features. default true |
| AnalyzeFlicker |
16 |
Flicker analysis. This value is effective when analyzing a series of frames in a video. default true
|
| AnalyzeMotion |
32 |
Motion analysis. This value is effective when analyzing a series of frames in a video. default true
|
| AnalyzeText |
64 |
Add text detection to the analysis. default true |
| AnalyzeFace |
128 |
Add face detection to the analysis. default true |
| AnalyzeSkin |
256 |
Add skin hue detection to the analysis. default true |
| AnalyzeFacialExpressions |
512 |
Add emotions and facial expressions detection to the analysis. default true |
OutputOptions (integer)
Specifies how the output heatmap file is generated and its content. This parameter
is a combination of accumulated flags from the following group of flags.
For example, to include MergeHeatmap (1) and OutputOpacityScores (2), set the OutputOptions = 1 + 2 = 3
| Name |
Value
|
Description
|
| Default |
0 |
Default output settings |
| MergeHeatmap |
1 |
Should the report include a merged layer of the input image. default true |
| OutputFocusScores |
2 |
Draw Focus scores over reports. default false.
Image: draws scores on focus report.
Video: draws scores on heatmap,gazeplpot,focus reports.
|
| OutputAestheticsScores |
4 |
Draw aesthetic scores over reports. default true for image.
Image: draws scores on aesthetics report.
Video: draws scores on heatmap,gazeplpot,focus reports.
|
| DrawLegend |
8 |
Draw map legend over heatmap and gazeplot reports . default true for image |
| OutputScoresChart |
16 |
Add bottom scores chart to reports. video only . default false |
| OutputOpacityWhite |
32 |
Create Focus Map Opacity report with white overlay instead of default black overlay. default false |
| OutputAutoAddAOIs |
64 |
Auto create and add AOIs to the AOIs list. default false |
| OutputDurationSegment1 |
128 |
Set output duration segment to 2.5 seconds. default false |
| OutputDurationSegment2 |
256 |
Set output duration segment to 5 seconds. default true |
| OutputDurationSegment3 |
512 |
Set output duration segment to 7.5 seconds. default false |
Request example
{
"id": "1768240240",
"method": "ImageAttention",
"params": {
"InputImage": "https://feng-gui.com/images/test.png",
"viewType": 0,
"ViewDistance": 0,
"AnalysisOptions": 0,
"OutputOptions": 0
}
}
Response
{
"id": "1768297367",
"result": {
"serviceVersion": "8.2.4.7",
"version": "8.2.4.7",
"imageID": "50214322-d72e-4110-8bcc-ea6ee5c0b725.png",
"inputImage": "https://feng-gui.com/images/test.png",
"outputImage": "https://service.feng-gui.com/users/USERNAME/files/images/50214322-d72e-4110-8bcc-ea6ee5c0b725_heatmap.png",
"outputAttentionImage": "https://service.feng-gui.com/users/USERNAME/files/images/50214322-d72e-4110-8bcc-ea6ee5c0b725_raw.png",
"analysisResult": 0,
"analysisOptions": 1023,
"outputOptions": 269,
"viewDistanceOptions": 0,
"viewTypeOptions": 0,
"faceDetected": true,
"skinDetected": false,
"textDetected": false,
"overall": 77,
"complexity": 12,
"clear": 88,
"focus": 66,
"exciting": 14,
"balance": 87,
"hotspots": [
{
"x": 888,
"y": 261,
"maxValue": 255
},
{
"x": 425,
"y": 435,
"maxValue": 202
},
{
"x": 1119,
"y": 190,
"maxValue": 168
},
{
"x": 783,
"y": 721,
"maxValue": 159
},
{
"x": 305,
"y": 420,
"maxValue": 72
},
{
"x": 977,
"y": 615,
"maxValue": 59
},
{
"x": 1155,
"y": 572,
"maxValue": 49
},
{
"x": 160,
"y": 783,
"maxValue": 42
},
{
"x": 685,
"y": 792,
"maxValue": 34
},
{
"x": 1158,
"y": 343,
"maxValue": 30
},
{
"x": 861,
"y": 379,
"maxValue": 29
},
{
"x": 1053,
"y": 507,
"maxValue": 28
},
{
"x": 136,
"y": 603,
"maxValue": 23
},
{
"x": 1228,
"y": 243,
"maxValue": 18
},
{
"x": 1298,
"y": 351,
"maxValue": 18
},
{
"x": 544,
"y": 457,
"maxValue": 16
},
{
"x": 770,
"y": 288,
"maxValue": 14
},
{
"x": 904,
"y": 712,
"maxValue": 14
},
{
"x": 139,
"y": 903,
"maxValue": 13
},
{
"x": 185,
"y": 435,
"maxValue": 11
}
],
"aOIs": [],
"faces": [
{
"top": 204,
"left": 848,
"width": 80,
"height": 119,
"emotion": "Neutral",
"confidence": 0.95,
"neutral": 0.95,
"happy": 0,
"surprise": 0,
"sad": 0.01,
"anger": 0.02,
"disgust": 0,
"fear": 0,
"contempt": 0.01
},
{
"top": 127,
"left": 1063,
"width": 112,
"height": 131,
"emotion": "Neutral",
"confidence": 0.93,
"neutral": 0.93,
"happy": 0.02,
"surprise": 0,
"sad": 0.03,
"anger": 0,
"disgust": 0,
"fear": 0,
"contempt": 0.02
}
],
"textAreas": [
{
"top": 364,
"left": 240,
"width": 222,
"height": 57,
"confidence": 1
},
{
"top": 924,
"left": 390,
"width": 122,
"height": 28,
"confidence": 1
},
{
"top": 395,
"left": 351,
"width": 170,
"height": 77,
"confidence": 1
},
{
"top": 922,
"left": 236,
"width": 135,
"height": 31,
"confidence": 1
},
{
"top": 484,
"left": 359,
"width": 49,
"height": 17,
"confidence": 0.47
},
{
"top": 487,
"left": 440,
"width": 70,
"height": 15,
"confidence": 0.42
}
]
}
}
SetImageAOIs method
Set the AOIs data of an image.
Credit: no credit is charged when using this method.
Method applies to image analysis.
Parameters
| Name | Type | Description |
| ImageID | String | The relative file name of the original image or video URL including the file extension .png or .mp4
for example, the image id of the following URL is /folder/ImageID.png
https://service.feng-gui.com/users/USERNAME/files/images/folder/ImageID.png
|
| AOIs | String | Escaped JSON format string of the AOIs regions. |
Request example
{
"method": "SetImageAOIs",
"params": {
"ImageID": "/test.png",
"AOIs": "[{\"id\":\"id1\",\"text\":\"Logo\",\"shape\":\"rect\",\"left\":10,\"top\":10,\"width\":200,\"height\":100}]"
},
"id": "{{$timestamp}}"
}
To generate an AOIs report:
1. Call ImageAttention method with the URL of the image located on your server.
2. From ImageAttention response, extract the newly created ImageID from the OutputImage URL
Here is an example of OutputImage URL
https://service.feng-gui.com/users/USERNAME/files/images/folder/ImageID_heatmap.png
The ImageID is /folder/ImageID.png
3. Use this ImageID and a JSON AOIs string to call SetImageAOIs(string ImageID, string AOIs)
Here is an example of an AOIs string
AOIs = '[{"units":"pixels","top":36,"left":75,"width":40,"height":40,"text":"face","id":"uuid1"},
{"units":"pixels","top":3,"left":220,"width":40,"height":50,"text":"product","id":"uuid2"},
{"units":"pixels","top":82,"left":14,"width":40,"height":40,"text":"face2","id":"uuid3"},
{"units":"pixels","top":0,"left":3,"width":32,"height":20,"text":"company name","id":"uuid4"},
{"units":"pixels","top":212,"left":317,"width":55,"height":23,"text":"brand name","id":"uuid5"},
{"units":"pixels","top":192,"left":221,"width":136,"height":25,"text":"tag line","id":"uuid6"}]'
4. Call ImageAttention method with the URL of the image located on Feng-GUI server. No credit is charged when analyzing images located on Feng-GUI server.
5. Download the AOIs report image with an additional timestamp parameter at the end of the URL.
For example:
https://service.feng-gui.com/users/USERNAME/files/images/folder/ImageID_aoi.png + "?" + (new Date()).getTime();
The report files are http cached and if you will not add a random parameter (like timestamp) to the URL, you might receive an HTTP status "304 Not Modified"
Response
None. On successful execution, this method returns an empty result.
GetImageAOIs method
Get the AOIs data of an image.
Credit: no credit is charged when using this method.
Method applies to image analysis.
Parameters
| Name | Type | Description |
| ImageID | String | The relative file name of the original image or video URL including the file extension .png or .mp4
for example, the image id of the following URL is /folder/ImageID.png
https://service.feng-gui.com/users/USERNAME/files/images/folder/ImageID.png
|
Request example
{
"id": "1768240240",
"method": "GetImageAOIs",
"params": {
"ImageID": "https://service.feng-gui.com/users/USERNAME/files/images/ImageID.png"
}
}
Response
The response is a string with the AOIs data in escaped JSON format.
Response example
{
"id": "1768240240",
"result": "[{\"id\":\"72eb0bc4-bdcf-c9a7-03cb-43bfe5395213\",\"text\":\"bear-1\",\"shape\":null,\"color\":null,\"StartTime\":0,\"EndTime\":0,\"units\":\"pixels\",\"top\":171.0,\"left\":740.0,\"width\":230.0,\"height\":432.0,\"VisibilityScore\":100,\"TimeToFirstFixation\":250,\"FixationsBefore\":0,\"FixationLength\":1250,\"FixationCount\":5,\"intensity\":22,\"orientation\":65,\"colorRedGreen\":58,\"colorBlueYellow\":71},{\"id\":\"408e70cb-b389-c169-af11-c51d1a4cfa04\",\"text\":\"bear-2\",\"shape\":null,\"color\":null,\"StartTime\":0,\"EndTime\":0,\"units\":\"pixels\",\"top\":101.0,\"left\":404.0,\"width\":233.0,\"height\":514.0,\"VisibilityScore\":95,\"TimeToFirstFixation\":500,\"FixationsBefore\":1,\"FixationLength\":2000,\"FixationCount\":8,\"intensity\":29,\"orientation\":63,\"colorRedGreen\":48,\"colorBlueYellow\":69},{\"id\":\"16ff6c10-e91a-3d1e-ac08-4f98901b4091\",\"text\":\"product\",\"shape\":null,\"color\":null,\"StartTime\":0,\"EndTime\":0,\"units\":\"pixels\",\"top\":398.0,\"left\":893.0,\"width\":219.0,\"height\":134.0,\"VisibilityScore\":31,\"TimeToFirstFixation\":750,\"FixationsBefore\":2,\"FixationLength\":750,\"FixationCount\":3,\"intensity\":26,\"orientation\":67,\"colorRedGreen\":47,\"colorBlueYellow\":62}]"
}
Scaled AOI values
AOI values can be scaled to several units: 'pixels', 'percent' and '384x256' (deprecated)
Scaling AOI units to '384x256' is deprecated. You should specify the exact pixels position, by set the units as 'pixels'
WebsiteCapture method
Capture a Website as an image and upload the image file to your account.
The file is uploaded into the root of the account folders.
Credit: one credit is charged for a successful execution.
Parameters
| Name | Type | Description |
| url | String | address of a webpage to capture and upload the snapshot image to the service |
CreateReport method
Create a pdf report.
Credit: no credit is charged when using this method.
Method applies to image analysis only.
Parameters
| Name | Type | Description |
| ImageID | String | The relative file name of the image or video including file extension .png or .mp4 |
| ReportTemplate | String | Report template file name. default:'template.mdddl' |
| parameters | String | extra query string parameters sent to the report. default:''
This field is for internal use only and should not be used in your code.
|
Response
The response is a string with the URL of the report pdf file.
VideoUpload method
Upload a video file to your account.
The file is uploaded into the root of the account folders.
Credit: one credit is charged for every 10 seconds of video.
Method applies to video analysis only.
Remarks
Performance Tip: Instead of using this VideoUpload method, you can upload the input video to your server and set the VideoAttention.InputVideo parameter as the URL path of the video.
Parameters
| Name | Type | Description |
| FileName | String | The name of the uploaded file.
The characters allowed for FileName are - a-z A-Z 0-9
The FileName will be renamed by the service to avoid non supported characters.
|
| FileData | String | The uploaded file encoded as base64 byte array. |
Response
The response is a string with the new file name of the uploaded file.
VideoAttention method
Feng-GUI attention analysis of a video.
Credit: one credit is charged for every 10 seconds of video.
Method applies to video analysis.
The method generates the Heatmap, Gaze plot and Opacity video reports in one execution.
| File | Path |
| Input video | http://SERVICE/users/USERNAME/files/images/ImageID.mp4 |
| Heatmap video report | http://SERVICE/users/USERNAME/files/images/ImageID_heatmap.mp4 |
| Gazeplot video report. Bee Swarm style | http://SERVICE/users/USERNAME/files/images/ImageID_gazeplot.mp4 |
| Opacity video report | http://SERVICE/users/USERNAME/files/images/ImageID_opacity.mp4 |
| Gaze Data fixations file | http://SERVICE/users/USERNAME/files/images/ImageID_gazedata.csv |
| Video Emotion Chart | http://SERVICE/users/USERNAME/files/images/ImageID_fer.png |
Video analysis can take a few minutes to finish, and the response is asynchronous.
To check if the analysis is done, poll the service status every minute and specify the analyzed resource using the
GetServiceStatus method.
Parameters
VideoAttention parameters are similar to those passed to
ImageAttention
Request example
{
"id": "1768240240",
"method": "VideoAttention",
"params": {
"InputVideo": "https://feng-gui.com/images/test.mp4",
"viewType": 0,
"ViewDistance": 0,
"AnalysisOptions": 0,
"OutputOptions": 0
}
}
GetAccountInfo method
Get account properties, credit and usage information of your account id.
Credit: no credit is charged when using this method.
Method applies to user account.
Parameters
| Name | Type | Description |
| UserIdOrEmail | String | The user name or email in Feng-GUI system. |
Response
The response is an AccountInfo object.
AccountInfo object
UserNameString. The account user name.
PasswordString. Password. Masked. This field is for internal use only and should not be used in your code.
EmailString. The account email address
RolesString. guest, customer, evaluation, test, api, readonly, annual, video.
StatusInteger. Account status. Disabled (0), Enabled (1), Affiliate(2).
UsedInteger. How many credits used by this user.
CreditInteger. How many credits available from valid plans and shared plans.
ServiceString. Service end point host address.
DateAddString. Date account was created.
FirstNameString.
LastNameString.
AddressString.
CityString.
ZipCodeString.
CountryString.
CompanyString.
StorageInteger. Storage Used in MB.
MailingInteger. Mailing options. INTERNAL. This field is for internal use only and should not be used in your code.
AffiliateString. Referring Affiliate Code.
Email2String. Finance email.
DateActiveString. last active date that user analyzed an image or video.
DateDeleteString. schedule to delete date.
StorageQuotaInteger. Storage Quota limit in MB. Calculated based on highest Credit plans.
StorageUsedInteger. Storage used in MB by all users of highest Credit plan.
StorageRetentionInteger. Storage Retention in days.
Response example
{
"id": "1768300608",
"result": {
"userName": "username",
"password": "",
"email": "support@feng-gui.com",
"roles": "customer,api,annual,enterprise,beta,business",
"status": 1,
"used": 2048,
"credit": 1202,
"service": "https://service.feng-gui.com",
"dateAdd": "2020-03-20 02:09:37",
"firstName": "first",
"lastName": "surename",
"address": "",
"city": "",
"zipCode": "",
"country": "",
"company": "Feng-GUI",
"storage": 1980,
"mailing": 0,
"affiliate": "",
"email2": "sales@feng-gui.com",
"dateActive": "2026-01-13",
"dateDelete": "",
"storageQuota": 10000,
"storageUsed": 1980,
"storageRetention": 8928
}
}
GetAccountCredits method
Get details about valid credit plans.
Credit: no credit is charged when using this method.
Method applies to user account.
Parameters
None.
Response
The response is an AccountCredits object.
AccountCredits object
CreditsAccountCredit[]. List of AccountCredit purchased and shared.
UsedCreditInteger. Sum of used credits in active plans.
RemainCreditInteger. Sum of valid credits left in active plans.
AccountCredit object
CreditIDInteger.
UserNameString.
PriceInteger.
CreditInteger.
UsedInteger. Used credits from this credit package plan
ExpireInteger. Expire Hours added to DateAdd
TXNString. Transaction number
InvoiceIDString. Finance invoice id
DateAddString. Date and Time of purchase
AffiliateString. affiliate code used in this transaction
Response example
{
"id": "1768300753",
"result": {
"credits": [
{
"creditID": 13529,
"userName": "username",
"price": 100,
"credit": 400,
"used": 10,
"expire": 744,
"tXN": "EGV6F2JF",
"invoiceID": "10498",
"dateAdd": "2025-01-27 11:36:57",
"affiliate": ""
}
],
"usedCredit": 1826,
"remainCredit": 1202
}
}
GetAccountUsage method
Get account usage for the recent 100 actions.
Credit: no credit is charged when using this method.
Method applies to user account.
Parameters
None.
Response
The response is an array of rows.
Response example
{
"id": "1768240240",
"result": {
"rows": [
{
"id": "245804",
"type": "2",
"value": "https://service.feng-gui.com/users/username/files/images/3625b0882eac.png analyzed as 3625b0882eac.png",
"dateAdd": "2020-01-15 16:59:10"
},
{
"id": "245803",
"type": "5",
"value": "3625b0882eac.png template.mdddl",
"dateAdd": "2020-01-15 15:51:13"
},
{
"id": "245802",
"type": "2",
"value": "https://service.feng-gui.com/users/username/files/images/3625b0882eac.png analyzed as 3625b0882eac.png",
"dateAdd": "2020-01-15 15:50:49"
},
{
"id": "245801",
"type": "1",
"value": "Screen Shot 2020-01-15 at 2.45.49 PM.png saved as af564223-d56b-4ea2-8e6f-3625b0882eac.png",
"dateAdd": "2020-01-15 15:49:12"
}
]
}
}
GetServiceStatus method
Check the status of the service.
Credit: no credit is charged when using this method.
Method applies to image and video analysis.
Use this method to check if a file is currently being analyzed.
Video analysis is done asynchronously and take at least a few minutes. Use this method to realize if the video analysis is still running.
Parameters
| Name | Type | Description |
| ImageID | String | The relative file name of the original image or video URL including the file extension .png or .mp4 |
Response
Type: Integer
0 - Idle
1 - Busy
2 - Analysis request accepted and is about to start.
Response example
{
"id": "1768301487",
"result": 0
}
GetDirectories method
Returns the names of the subdirectories in the specified directory.
Credit: no credit is charged when using this method.
Parameters
| Name | Type | Description |
| VirtualSourcePath | String | The relative path to the directory to search. |
examples:
GetDirectories("/") to get the directories under root directory
GetDirectories("/dir1/") to get the directories under dir1 directory
Request example
{
"id": "1768301563",
"method": "GetDirectories",
"params": {
"VirtualSourcePath": "/"
}
}
Response
An array of the full names of the subdirectories, or an empty array if no directories are found.
Response example
{
"id": "1768301563",
"result": [
"Ads",
"creatives",
"demo",
"package",
"Print",
"private",
"website"
]
}
GetFiles method
Returns the names of files that match the specified search pattern in the specified directory.
Credit: no credit is charged when using this method.
Parameters
| Name | Type | Description |
| VirtualSourcePath | String | The relative path to the directory to search. |
| Pattern | String | The search string to match against the names of files in path. |
examples:
GetFiles("/", "*_thumb.png") gets all image thumbnail files under root directory
GetFiles("/dir1/", "*.mp4") gets all video files under dir1 directory
Request example
{
"id": "1768301563",
"method": "GetFiles",
"params": {
"VirtualSourcePath": "/",
"Pattern": "*.png"
}
}
Response
An array of the full names for the files in the specified directory that match the specified search pattern, or an empty array if no files are found.
Response example
{
"id": "1768306940",
"result": [
"test_heatmap.png",
"test_aes.png",
"test_aoi.png",
"test_opacity.png",
"test_gazeplot.png",
"test_raw.png",
"test_raw_vf.png",
"test_aoi.png",
"test_aes.png",
"test_heatmap.png",
"test_gazeplot.png",
"test_opacity.png",
"test_raw_vf.png",
"test_raw.png",
"test.png",
"test_thumb.png"
]
}
DeleteDirectory method
Delete a directory and all its files and their related report files.
Credit: no credit is charged when using this method.
Parameters
| Name | Type | Description |
| VirtualDestPath | String | The relative directory to delete. |
examples:
DeleteDirectory("/dirA/dirB") to delete the directory 'dirB'
DeleteDirectory("/dirA") to delete the directory 'dirA' at the root of the files storage
Request example
{
"id": "1768306940",
"method": "DeleteDirectory",
"params": {
"VirtualDestPath": "/tests/subfolder"
},
}
Response
None. On successful execution, this method returns an empty result.
Response example
{
"id": "1768306940",
"result": null
}
DeleteFile method
Delete a file and all its related report files.
Credit: no credit is charged when using this method.
Parameters
| Name | Type | Description |
| VirtualDestPath | String | The file to delete. |
The relative file name of the original image or video URL including the file extension .png or .mp4
examples:
DeleteFile("/dirA/filename.png") to delete the file 'filename.png' in directory 'dirA'
DeleteFile("/filename.png") to delete the the 'filename.png' at the root of the files storage
Request example
{
"id": "1768306940",
"method": "DeleteFile",
"params": {
"VirtualDestPath": "/test.png"
}
}
Response
None. On successful execution, this method returns an empty result.
Response example
{
"id": "1768312158",
"result": null
}
Exceptions and Error Codes
An exception that signals that a SOAP or JSON exception has occurred.
Credit: Credit is not charged for an unsuccessful transaction.
Exceptions
CaptureFailedException
Analysis creation failed. See the exception message for more details about the failure cause.
ServiceTimeoutException
The operation has reached timeout.
It is most likely that you are using a very large image. Try to reduce the image dimensions and invoke the method again.
InsufficientRolePermissionsException
Your account role has insufficient permissions to perform this operation.
InsufficientCreditException
There is not enough credit in your account to perform this operation.
When you ran out of credits, you cannot upload or analyze new images.
When package expires, you cannot analyze an existing image.
ConsecutiveLoginFailuresException
To prevent hackers from brute force login, an account will be disabled for 10 minutes after 3 consecutive login failures.
The API Throws the ConsecutiveLoginFailuresException exception and the service return HTTP error "503 Service Temporarily Unavailable" error.
FilesOperationException
File and directory operation errors.
See the exception message for more details about the failure cause.
Error Codes
96: Login failed
The login details passed were invalid.
97: User not logged in
The method requires user authentication but the user was not logged
in.
98 Insufficient Role permissions
The authenticated user did not have the required Role permissions.
105: Service currently unavailable
The requested service is temporarily unavailable.
112: Method "method name" not found
The requested method was not found.
115: Invalid XML-RPC Method Call
The XML-RPC request document could not be parsed.
116: Capture web page or image failed
The request has failed to retrieve the image file or the webpage.