DeveloperDeveloper
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
Forum
Projects Library
Dev Discord
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
Forum
Projects Library
Dev Discord
  • Standard Solutions (with Lovense Remote)

    • Introduction
    • Standard API
    • Standard Socket API
    • Standard JS SDK
    • Toy Events API
Got Stuck?
Forum for Lovense Developers
Click to explore the release pose for Standard API
Support
Document Feedback

Standard API

This API allows any application to access its users Lovense toys from the developer side.

Here is a sample demo for your reference.

Step 1: Configure the developer dashboard

Go to the developer dashboard and set your Callback URL.

Set your Callback URL

Step 2: Find your user's toy(s)

  1. Get your developer token from the Lovense developer dashboard.

  2. Your server calls Lovense server's API (use POST request)

    For example:

    String url= "https://api.lovense-api.com/api/lan/getQrCode";
    Map<String, String> requestParameter = new HashMap<String, String>();
    //TODO initialize your parameters:
    requestParameter.put("token", "{Lovense developer token}");
    requestParameter.put("uid", "{user ID on your website}");
    requestParameter.put("uname", "{user nickname on your website}");
    requestParameter.put("utoken", "{Encrypted user token on your application. This is a security consideration, to avoid others stealing control of the toy.}");
    requestParameter.put("v", 2);
    HttpPost httpPost = new HttpPost(url);
    List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
    if (requestParameter != null && !requestParameter.isEmpty()) {
      Set<String> keys = requestParameter.keySet();
      for (String key : keys) {
        nameValuePairs.add(new BasicNameValuePair(key, requestParameter.get(key)));
      }
    }
    httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "utf-8"));
    
    const result = await axios.post(
      "https://api.lovense-api.com/api/lan/getQrCode",
      {
        token: "your developer token", // Lovense developer token
        uid: "11111", // user ID on your website
        uname: "user name", // user nickname on your website
        utoken: md5(uid + "salt"), // This is for your own verification purposes. We suggest you to generate a unique token/secret for each user. This allows you to verify the user and avoid others faking the calls.
        v: 2,
      }
    )
    

    You will get:

    {
       code: 0
       message: "Success"
       result: true
       data: {
         "qr": "https://test2.lovense.com/UploadFiles/qr/20220106/xxx.jpg", // QR code picture
         "code": "xxxxxx"
       }
    }
    
  3. Once the user scans the QR code with the Lovense Remote app, the app will invoke the Callback URL you've provided in the developer dashboard. The Lovense server is no longer required. All communications will go from the app to your server directly.

    TIP

    The QR code will expire after 4 hours.

    The Lovense Remote app will send the following POST to your server:

    {
      "uid": "xxx",
      "appVersion": "4.0.3",
      "toys": {
        "xxxx": {
          "nickName": "",
          "name": "max",
          "id": "xxxx",
          "status": 1
        }
      },
      "wssPort": "34568",
      "httpPort": "34567",
      "wsPort": "34567",
      "appType": "remote",
      "domain": "192-168-1-44.lovense.club",
      "utoken": "xxxxxx",
      "httpsPort": "34568",
      "version": "101",
      "platform": "android"
    }
    

Step 3: Command the toy(s)

Note: iOS Remote 5.1.4+, Android Remote 5.1.1+, or PC Remote 1.5.8+ is required.

By local application

If the user's device is in the same LAN environment, a POST request to Lovense Remote can trigger a toy response. In this case, your server and Lovense's server are not required.

If the user uses the mobile version of Lovense Remote app, the domain and httpsPort are accessed from the callback information. If the user uses Lovense Remote for PC, the domain is 127-0-0-1.lovense.club, and the httpsPort is 30010

With the same command line, different parameters will lead to different results as below.

GetToys Request

Get the user's toy(s) information.

API URL: https://{domain}:{httpsPort}/command

Request Protocol: HTTPS Request

Method: POST

Request Content Type: application/json

Response Format: JSON

Headers:

NameDescriptionNoteRequired
X-platformThe name of your applicationWill be displayed on the Lovense Remote screen.yes

Parameters:

NameDescriptionTypeNoteRequired
commandType of requeststring/yes

Request Example:

{
  "command": "GetToys"
}

Response Example:

{
  "code": 200,
  "data": {
    "toys": "{  \"f082c00246fa\" : {    \"id\" : \"f082c00246fa\",    \"status\" : \"1\",    \"version\" : \"\",    \"name\" : \"nora\",    \"battery\" : 60,    \"nickName\" : \"\",    \"shortFunctionNames\" : [      \"v\",    \"r\"    ],    \"fullFunctionNames\" : [       \"Vibrate\",    \"Rotate\"    ]  }}",
    "platform": "ios",
    "appType": "remote"
  },
  "type": "OK"
}

GetToyName Request

Get the user's toy(s) name.

API URL: https://{domain}:{httpsPort}/command

Request Protocol: HTTPS Request

Method: POST

Request Content Type: application/json

Response Format: JSON

Headers:

NameDescriptionNoteRequired
X-platformThe name of your applicationWill be displayed on the Lovense Remote screen.yes

Parameters:

NameDescriptionTypeNoteRequired
commandType of requeststring/yes

Request Example:

{
  "command": "GetToyName"
}

Response Example:

{
  "code": 200,
  "data": ["Domi", "Nora"],
  "type": "OK"
}

Function Request

API URL: https://{domain}:{httpsPort}/command

Request Protocol: HTTPS Request

Method: POST

Request Content Type: application/json

Response Format: JSON

Headers:

NameDescriptionNoteRequired
X-platformThe name of your applicationWill be displayed on the Lovense Remote screen.yes

Parameters:

NameDescriptionTypeNoteRequired
commandType of requeststring/yes
actionControl the function and strength of the toystringActions can be Vibrate, Rotate, Pump, Thrusting, Fingering, Suction, Depth, Stroke, Oscillate or Stop. Use All to make all functions respond. Use Stop to stop the toy’s response.
Range:
Vibrate:0 ~ 20
Rotate: 0~20
Pump:0~3
Thrusting:0~20
Fingering:0~20
Suction:0~20
Depth: 0~3
Stroke: 0~100
Oscillate:0~20
All:0~20

⚠️ Stroke should be used in conjunction with Thrusting, and there should be a minimum difference of 20 between the minimum and maximum values. Otherwise, it will be ignored.
yes
timeSecTotal running timedouble0 = indefinite length
Otherwise, running time should be greater than 1.
yes
loopRunningSecRunning timedoubleShould be greater than 1no
loopPauseSecSuspend timedoubleShould be greater than 1no
toyToy IDstringIf you don’t include this, it will be applied to all toysno
stopPreviousStop all previous commands and execute current commandsintDefault: 1, If set to 0 , it will not stop the previous command.no
apiVerThe version of the requestintAlways use 1yes

The stopPrevious parameter is available in the following versions: Android Remote 5.2.2, iOS Remote 5.4.4, PC Remote 1.6.3.

Request Example:

// Vibrate toy ff922f7fd345 at 16th strength, run 9 seconds then suspend 4 seconds. It will be looped. Total running time is 20 seconds.
{
  "command": "Function",
  "action": "Vibrate:16",
  "timeSec": 20,
  "loopRunningSec": 9,
  "loopPauseSec": 4,
  "toy": "ff922f7fd345",
  "apiVer": 1
}
// Vibrate 9 seconds at 2nd strength
// Rotate toys 9 seconds at 3rd strength
// Pump all toys 9 seconds at 4th strength
// For all toys, it will run 9 seconds then suspend 4 seconds. It will be looped. Total running time is 20 seconds.
{
  "command": "Function",
  "action": "Vibrate:2,Rotate:3,Pump:3",
  "timeSec": 20,
  "loopRunningSec": 9,
  "loopPauseSec": 4,
  "apiVer": 1
}
// Vibrate 9 seconds at 2nd strength
// The rest of the functions respond to 10th strength 9 seconds
{
  "command": "Function",
  "action": "Vibrate:2,All:10",
  "timeSec": 20,
  "loopRunningSec": 9,
  "loopPauseSec": 4,
  "apiVer": 1
}
// Thrust 20 seconds at 10th strength and stroke range of 0-20
{
  "command": "Function",
  "action": "Stroke:0-20,Thrusting:10",
  "timeSec": 20,
  "apiVer": 1
}
// Stop all toys
{
  "command": "Function",
  "action": "Stop",
  "timeSec": 0,
  "apiVer": 1
}

Position Request

Controls the stroker of Solace Pro to move to a specified position(0~100). It is suitable for scenarios requiring real-time control. If you have a predefined pattern, suggest to use PatternV2 Request.

solace-pro

API URL: https://{domain}:{httpsPort}/command

Request protocol: HTTPS Request

Method: POST

Request Content Type: application/json

Response Format: JSON

Parameters:

NameDescriptionTypeNoteRequired
commandType of requeststring/yes
valueThe position of the strokerstringvalue: 0~100yes
toyToy IDstringIf you don’t include this, it will apply to all connected toysno
apiVerThe version of the requestintAlways use 1yes

Request Example:

{
  "command": "Position",
  "value": "38", //0~100
  "toy": "ff922f7fd345", // If you don’t include this, it will be applied to all connected Solace Pro
  "apiVer": 1
}

Response Example:

{
  "code": 200,
  "type": "ok"
}

Tips

  1. The stroker will continue moving 300 miliseconds after a position command is executed. If a new command is received during this time, it will be executed immediately. The more frequently commands are sent, the smoother the stroker movement will be.

  2. It takes about 1 to 2 seconds for the stroker to reach the desired speed from rest. During this time, the stroker may not closely match the desired movement.

Pattern Request

If you want to change the way the toy responds very frequently you can use a pattern request. To avoid network pressure and obtain a stable response, use the commands below to send your predefined patterns at once.

API URL: https://{domain}:{httpsPort}/command

Request protocol: HTTPS Request

Method: POST

Request Content Type: application/json

Response Format: JSON

Headers:

NameDescriptionNoteRequired
X-platformThe name of your applicationWill be displayed on the Lovense Remote screen.yes

Parameters:

NameDescriptionTypeNoteRequired
commandType of requeststring/yes
rule"V:1;F:v,r,p,t,f,s,d,o;S:1000#"
V:1; Protocol version, this is static;
F:v,r,p,t,f,s,d,o; Features: v is vibrate, r is rotate, p is pump, t is thrusting, f is fingering, s is suction, d is depth, o is oscillate, this should match the strength below.
F:; Leave blank to make all functions respond;
S:1000; Intervals in Milliseconds, should be greater than 100.
stringThe strength of r and p, d will automatically correspond to v.yes
strengthThe pattern
For example: 20;20;5;20;10
stringNo more than 50 parameters. Use semicolon ; to separate every strength.yes
timeSecTotal running timedouble0 = indefinite length
Otherwise, running time should be greater than 1.
yes
toyToy IDstringIf you don’t include this, it will apply to all toysno
apiVerThe version of the requestintAlways use 2yes

Request Example:

// Vibrate the toy as defined. The interval between changes is 1 second. Total running time is 9 seconds.
{
  "command": "Pattern",
  "rule": "V:1;F:v;S:1000#",
  "strength": "20;20;5;20;10",
  "timeSec": 9,
  "toy": "ff922f7fd345",
  "apiVer": 2
}
// Vibrate the toys as defined. The interval between changes is 0.1 second. Total running time is 9 seconds.
// If the toys include Nora or Max, they will automatically rotate or pump, you don't need to define it.
{
  "command": "Pattern",
  "rule": "V:1;F:v,r,p;S:100#",
  "strength": "20;20;5;20;10",
  "timeSec": 9,
  "apiVer": 2
}

PatternV2 Request

The 2nd version of the Pattern Request includes four operations: Setup, Play, Stop, and SyncTime. For now, it is only available for the position control of Solace Pro. It is suitable for scenarios with a predefined pattern. If real-time control of position is needed, suggest to use Position Request.

Setup

Set up a predefined pattern.

API URL: https://{domain}:{httpsPort}/command

Request protocol: HTTPS Request

Method: POST

Request Content Type: application/json

Response Format: JSON

Parameters:

NameDescriptionTypeNoteRequired
commandType of requeststring/yes
typeType of operationstring/yes
actions[{"ts":0,"pos":10},{"ts":100,"pos":100},{"ts":200,"pos":10},{"ts":400,"pos":15},{"ts":800,"pos":88}]array of objectEach action consists of a timestamp (in ms) and a corresponding position value (0~100).
- ts: Must be greater than the previous one and the maximum value is 7200000. Invalid data will be removed.
- pos: The value range is 0~100. Invalid data will be removed.
yes
apiVerThe version of the requestintAlways use 1yes

Request Example:

{
  "command": "PatternV2",
  "type": "Setup",
  "actions": [
    { "ts": 0, "pos": 10 },
    { "ts": 100, "pos": 100 },
    { "ts": 200, "pos": 10 },
    { "ts": 400, "pos": 15 },
    { "ts": 800, "pos": 88 }
  ],
  "apiVer": 1
}

Response Example:

{
  "code": 200,
  "type": "ok"
}

Play

Play the predefined pattern.

API URL: https://{domain}:{httpsPort}/command

Request protocol: HTTPS Request

Method: POST

Request Content Type: application/json

Response Format: JSON

Parameters:

NameDescriptionTypeNoteRequired
commandType of operationstring/yes
startTimeThe start time of playbackintThe value range is 0~7200000 (in ms).
If you don’t include this, it will start playing from 0.
no
offsetTimeThe client-server offset timeintSet the client-server offset time to ensure that the toy is synchronized with the client.
The value range is 0~15000 (in ms).
If you don’t include this, it will be set to 0.
no
timeMsTotal running timedoubletimeMs must be at least greater than 100, otherwise it will be ignored.
no
toyToy IDstringIf you don’t include this, it will be applied to all connected toys.no
apiVerThe version of the requestintAlways use 1yes

Request Example:

{
  "command": "PatternV2",
  "type": "Play",
  "toy": "ff922f7fd345",
  "startTime": 100,
  "offsetTime": 300,
  "apiVer": 1
}

Response Example:

{
  "code": 200,
  "type": "ok"
}

Stop

Stop playing the predefined pattern.

API URL: https://{domain}:{httpsPort}/command

Request protocol: HTTPS Request

Method: POST

Request Content Type: application/json

Response Format: JSON

Parameters:

NameDescriptionTypeNoteRequired
commandType of operationstring/yes
toyToy IDstringIf you don’t include this, it will be applied to all connected toys.no
apiVerThe version of the requestintAlways use 1yes

Request Example:

{
  "command": "PatternV2",
  "type": "Stop",
  "toy": "ff922f7fd345",
  "apiVer": 1
}

Response Example:

{
  "code": 200,
  "type": "ok"
}

SyncTime

Use SyncTime to help you calculate the offset time from the server. Before sending the request, record the time T1; once you receive a successful response to the request, record the time T2. The estimated offset can then be calculated: offsetTime = (T2 - T1).

API URL: https://{domain}:{httpsPort}/command

Request protocol: HTTPS Request

Method: POST

Request Content Type: application/json

Response Format: JSON

Parameters:

NameDescriptionTypeNoteRequired
commandType of operationstring/yes
apiVerThe version of the requestintAlways use 1yes

Request Example:

{
  "command": "PatternV2",
  "type": "SyncTime",
  "apiVer": 1
}

Response Example:

{
  "code": 200,
  "type": "ok"
}

Preset Request

API URL: https://{domain}:{httpsPort}/command

Request protocol: HTTPS Request

Method: POST

Request Content Type: application/json

Response Format: JSON

Headers:

NameDescriptionNoteRequired
X-platformThe name of your applicationWill be displayed on the Lovense Remote screen.yes

Parameters:

NameDescriptionTypeNoteRequired
commandType of requeststring/yes
namePreset pattern namestringWe provide four preset patterns in the Lovense Remote app: pulse, wave, fireworks, earthquakeyes
timeSecTotal running timedouble0 = indefinite length
Otherwise, running time should be greater than 1.
yes
toyToy IDstringIf you don’t include this, it will be applied to all toysno
apiVerThe version of the requestintAlways use 1yes

Request Example:

// Vibrate the toy with pulse pattern, the running time is 9 seconds.
{
  "command": "Preset",
  "name": "pulse",
  "timeSec": 9,
  "toy": "ff922f7fd345",
  "apiVer": 1
}

Response Example:

{
  "code": 200,
  "type": "ok"
}

Error Codes:

CodeMessage
500HTTP server not started or disabled
400Invalid Command
401Toy Not Found
402Toy Not Connected
403Toy Doesn't Support This Command
404Invalid Parameter
506Server Error. Restart Lovense Connect.

By server

If your application can’t establish a LAN connection to the user’s Lovense Remote app, you can use the Server API to connect the user’s toy.

⚠️ If you are using Lovense Remote for PC, you need to enter a code to establish connection. Use the code generated alongside the QR code in step 2 above.

pc-remote-code

  • Function Request

    API URL: https://api.lovense-api.com/api/lan/v2/command

    Request Protocol: HTTPS Request

    Method: POST

    Request Content Type: application/json

    Request Format: JSON

    Parameters:

    NameDescriptionTypeNoteRequired
    tokenYour developer tokenstringyes
    uidYour user’s IDstringTo send commands to multiple users at the same time, add all the user IDs separated by commas. The toy parameter below will be ignored and the commands will go to all user toys by default.yes
    commandType of requeststring/yes
    actionControl the function and strength of the toystringActions can be Vibrate, Rotate, Pump, Thrusting, Fingering, Suction, Depth, Stroke, Oscillate or Stop. Use All to make all functions respond. Use Stop to stop the toy’s response.
    Range:
    Vibrate:0 ~ 20
    Rotate: 0~20
    Pump:0~3
    Thrusting:0~20
    Fingering:0~20
    Suction:0~20
    Depth: 0~3
    Stroke: 0~100
    Oscillate:0~20
    All:0~20

    ⚠️ Stroke should be used in conjunction with Thrusting, and there should be a minimum difference of 20 between the minimum and maximum values. Otherwise, it will be ignored.
    yes
    timeSecTotal running timedouble0 = indefinite length
    Otherwise, running time should be greater than 1.
    yes
    loopRunningSecRunning timedoubleShould be greater than 1no
    loopPauseSecSuspend timedoubleShould be greater than 1no
    toyToy IDstringIf you don’t include this, it will be applied to all toysno
    stopPreviousStop all previous commands and execute current commandsintDefault: 1, If set to 0 , it will not stop the previous command.no
    apiVerThe version of the requestintAlways use 1yes

    The stopPrevious parameter is available in the following versions: Android Remote 5.2.2, iOS Remote 5.4.4, PC Remote 1.6.3.

    Request Example:

    // Vibrate toy ff922f7fd345 at 16th strength, run 9 seconds then suspend 4 seconds. It will be looped. Total running time is 20 seconds.
    {
      "token": "FE1TxWpTciAl4E2QfYEfPLvo2jf8V6WJWkLJtzLqv/nB2AMos9XuWzgQNrbXSi6n",
      "uid": "1132fsdfsd",
      "command": "Function",
      "action": "Vibrate:16",
      "timeSec": 20,
      "loopRunningSec": 9,
      "loopPauseSec": 4,
      "apiVer": 1
    }
    
    // Vibrate 9 seconds at 2nd strength
    // Rotate toys 9 seconds at 3rd strength
    // Pump all toys 9 seconds at 4th strength
    // For all toys, it will run 9 seconds then suspend 4 seconds. It will be looped. Total running time is 20 seconds.
    {
      "token": "FE1TxWpTciAl4E2QfYEfPLvo2jf8V6WJWkLJtzLqv/nB2AMos9XuWzgQNrbXSi6n",
      "uid": "1132fsdfsd",
      "command": "Function",
      "action": "Vibrate:2,Rotate:3,Pump:3",
      "timeSec": 20,
      "loopRunningSec": 9,
      "loopPauseSec": 4,
      "apiVer": 1
    }
    
  • Pattern Request

    If you want to change the way the toy responds very frequently you can use a pattern request. To avoid network pressure and obtain a stable response, use the commands below to send your predefined patterns at once.

    API URL: https://api.lovense-api.com/api/lan/v2/command

    Request protocol: HTTPS Request

    Method: POST

    Request Content Type: application/json

    Response Format: JSON

    Parameters:

    NameDescriptionTypeNoteRequired
    tokenYour developer tokenstringyes
    uidYour user’s IDstringyes
    commandType of requeststring/yes
    rule"V:1;F:v,r,p,t,f,s,d,o;S:1000#"
    V:1; Protocol version, this is static;
    F:v,r,p,t,f,s,d,o; Features: v is vibrate, r is rotate, p is pump, t is thrusting, f is fingering, s is suction, d is depth, o is oscillate, this should match the strength below;
    S:1000; Intervals in Milliseconds, should be greater than 100.
    stringThe strength of r and p will automatically correspond to v.yes
    strengthThe pattern
    For example: 20;20;5;20;10
    stringNo more than 50 parameters. Use semicolon ; to separate every strength.yes
    timeSecTotal running timedouble0 = indefinite length
    Otherwise, running time should be greater than 1.
    yes
    toyToy IDstringIf you don’t include this, it will apply to all toysno
    apiVerThe version of the requestintAlways use 2yes

    Request Example:

    // Vibrate the toy as defined. The interval between changes is 1 second. Total running time is 9 seconds.
    {
      "token": "FE1TxWpTciAl4E2QfYEfPLvo2jf8V6WJWkLJtzLqv/nB2AMos9XuWzgQNrbXSi6n",
      "uid": "1ads22adsf",
      "command": "Pattern",
      "rule": "V:1;F:v;S:1000#",
      "strength": "20;20;5;20;10",
      "timeSec": 9,
      "apiVer": 2
    }
    
    // Vibrate the toys as defined. The interval between changes is 0.1 second. Total running time is 9 seconds.
    // If the toys include Nora or Max, they will automatically rotate or pump, you don't need to define it.
    {
      "token": "FE1TxWpTciAl4E2QfYEfPLvo2jf8V6WJWkLJtzLqv/nB2AMos9XuWzgQNrbXSi6n",
      "uid": "1ads22adsf",
      "command": "Pattern",
      "rule": "V:1;F:v,r,p;S:100#",
      "strength": "20;20;5;20;10",
      "timeSec": 9,
      "apiVer": 2
    }
    
  • Preset Request

    API URL: https://api.lovense-api.com/api/lan/v2/command

    Request protocol: HTTPS Request

    Method: POST

    Request Content Type: application/json

    Request Format: JSON

    Parameters:

    NameDescriptionTypeNoteRequired
    tokenYour developer tokenstringyes
    uidYour user’s IDstringyes
    commandType of requeststring/yes
    namePreset pattern namestringWe provide four preset patterns in the Lovense Remote app: pulse, wave, fireworks, earthquakeyes
    timeSecTotal running timedouble0 = indefinite length
    Otherwise, running time should be greater than 1.
    yes
    toyToy IDstringIf you don’t include this, it will be applied to all toysno
    apiVerThe version of the requestintAlways use 1yes

    Request Example:

    // Vibrate the toy with pulse pattern, the running time is 9 seconds.
    {
      "token": "FE1TxWpTciAl4E2QfYEfPLvo2jf8V6WJWkLJtzLqv/nB2AMos9XuWzgQNrbXSi6n",
      "uid": "1adsf2323",
      "command": "Preset",
      "name": "pulse",
      "timeSec": 9,
      "apiVer": 1
    }
    

Response Example:

{
  "result": true,
  "code": 200,
  "message": "Success"
}

Server Error Codes:

CodeMessage
200Success
400Invalid command
404Invalid Parameter
501Invalid token
502You do not have permission to use this API
503Invalid User ID
507Lovense APP is offline

Game Mode

If you are developing an offline game or application, we recommend this solution.

  1. Enable Game Mode in Lovense Remote

Go to Discover -> Game Mode -> Turn on the "Enable LAN" switch

game-mode

  1. Get the Local IP address

Users input the Local IP address from the Game Mode tab into your game. The machine running your game and Lovense Remote app must be on the same LAN.

  1. Command the user's toys

game-mode

Once the user has connected to your game, you can command the user's toy(s). Here is a link to the commands list (they're the same as the Standard API).

Last Updated:
Explore our Forum or Support to get more inspiration or solve your problems.
Discord Channel
It is an online real-time channel where you can communicate directly with our official administrators or many excellent developers.
Forum
It is a place for Lovense developers to communicate, where you can find solutions to problems or get inspired for your projects.
Support
Find documents and tutorials that may be helpful to you.