Accessing GoodWe Sems Portal API: A Comprehensive Guide

Binod Karunanayake
2 min readJun 27, 2023

--

Source: https://community.goodwe.com/solution/API%20introduction

If you are a user of GoodWe inverters and batteries, you might be interested in accessing the GoodWe Sems Portal API to retrieve data and integrate it into your own applications or systems. However, due to the lack of public documentation, it can be challenging to figure out how to access the API. In this article, I will explore the steps to access the GoodWe Sems Portal API using cURL.

Step 1: CrossLogin — Obtaining a Token

To access the GoodWe Sems Portal API, the first step is to obtain an authentication token by using the CrossLogin endpoint. This token will be used for subsequent API requests. Here’s an example of how to make the request.

curl --location 'https://www.semsportal.com/api/v1/Common/CrossLogin' \
--header 'Content-Type: application/json' \
--header 'Token: {"version":"v2.1.0","client":"ios","language":"en"}' \
--data-raw '{"account":"<email>","pwd":"<password>"}'

In the response, you will receive a JSON object containing the token, uid, timestamp, api and other relevant information. Here’s a sample response for the above request.

{
"hasError": false,
"code": 0,
"msg": "Successful",
"data": {
"uid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"timestamp": 1687866265523,
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"client": "ios",
"version": "v2.1.0",
"language": "en"
},
"components": {
"para": null,
"langVer": 179,
"timeSpan": 0,
"api": "http://hk.semsportal.com:82/api/Auth/GetToken",
"msgSocketAdr": "https://hk-xxzx.semsportal.com"
},
"api": "https://hk.semsportal.com/api/"
}

Step 2: GetMonitorDetailByPowerstationId — Retrieving Monitor Details

Once you have obtained the authentication token, you can use it to retrieve monitor details by using the GetMonitorDetailByPowerstationId endpoint. This endpoint provides information about a specific power station associated with your GoodWe inverters and batteries.

curl --location '<api>/v1/PowerStation/GetMonitorDetailByPowerstationId' \
--header 'Content-Type: application/json' \
--header 'Token:{"version":"v2.1.0","client":"ios","language":"en","timestamp":"<timestamp>","uid":"<uid>","token":"<token>"}' \
--data '{"powerStationId":"<powerStationId>"}'

In above request, replace <api> with the URL obtained from the CrossLogin response. Also, ensure to provide the <timestamp>, <uid>, and <token> values as obtained from the CrossLogin response. <powerStationId> can be found by observing the URL (https://www.semsportal.com/PowerStation/PowerStatusSnMin/<powerStationId>) after login in to GoodWe Sems Portal. The response for the above request contains information about a given power station.

Note:
If you encounter “The authorization has expired, please log in again.” error, then following reasons may cause for the error.
1. generated token is expired
2. URL is not as same as the provided URL under api in token response.
3. you have provided different clients under Token header for CrossLogin and GetMonitorDetailByPowerstationId requests.

Accessing the GoodWe Sems Portal API gives you the flexibility integrate your GoodWe inverters and batteries with other systems or applications. Currently, there is no public documentation available for the GoodWe Sems Portal API. However, according to https://community.goodwe.com/solution/API%20introduction, the API service is provided by the GoodWe SEMS team. If you are interested in accessing the API, it is recommended to contact the GoodWe service team for assistance.

Happy integrating with the GoodWe Sems Portal API!

--

--

Binod Karunanayake
Binod Karunanayake

Written by Binod Karunanayake

PhD Candidate @RMIT University | Former Software Engineer @WSO2 | BSc Engineering (Hons) University of Moratuwa

Responses (5)