WOVN.io API

This document explains WOVN.io’s API

Page Translation Data Scraping API

API Path

GET https://api.wovn.io/v0/values

The WOVN.io Library uses the API path in order to replace texts and images.

Parameter

Parameter name Description Required
token WOVN.io account’s user token yes
URL original URL yes

Sample Response

GET https://api.wovn.io/v0/values (when token, url are both not included)

Status Code: 400
Content-Type: application/json
{
 "code": 400,
 "message": "url and token parameters are required."
}

GET https://api.wovn.io/v0/values?token=2Wle3 (when url is not included)

Status Code: 400
Content-Type: application/json
{
 "code": 400,
 "message": "url parameter is required."
}

GET https://api.wovn.io/v0/values?url=wovn.io%2Fcontact (when token is not included)

Status Code: 400
Content-Type: application/json
{
 "code": 400,
 "message": "token parameter is required."
}

GET https://api.wovn.io/v0/values?token=2Wle3&url=wovn.io%2Fcontact

Status Code: 200
Content-Type: application/json
{
    // the page's texts' translations
    "text_vals": {
        "Orders": { // The original text before translation.
            "ja": [ // The destination language. The text cannot be translated, if this is left empty.
                {
                    "xpath": "/html/body/div/div/ul/li[4]/ul/li[5]/a/text()", // the text element's XPath
                    "data": "オーダー" // the translated text
                }
            ],
            ...
        },
        ...
    },

    // the page's images' translations
    "img_vals": {
        "https://wovn.io/assets/header_logo.png": { // the image's original URL
            "": [ // The destination language. The image cannot be replaced, if this is left empty.
                {
                    "xpath": "/html/body/div/a/img", // the image element's XPath
                    "data": "https://s3-us-west-1.amazonaws.com/st.wovn.io/" // the replacement image's URL
                }
            ]
        },
        ...
    },

    // Unused data. Always an empty object.
    "layout_vals": {
    }
}

Project Translation Text Search API

API Path

GET https://api.wovn.io/v0/project/values

This is the API Path used to search for translated text within the Project.

Parameter

Parameter name Description Required
srcs The translation text you want to search for. Specified as a JSON array. The maximum size is 100. yes
host The hostname of the translation text you want to search for. If you set Project token to token parameter, this parameter is not required. yes
target_lang The language of the translation text you want to search for. yes
token User token (5 characters) or Project token (6 characters). yes

Sample Response

POST https://api.wovn.io/v0/project/values
srcs: [“hello”, “abcde”]
host: example.com
target_lang: ja
token: abcde

Status Code: 200
Content-Type: application/json
{
    "results": [
        {
            "src": "hello", // The original text before translation.
            "dst": "こんにちは" // The translated text.
        },
        {
            "src": "abcde",
            "dst": null // If there is no translation, null will be returned.
        }
    ]
}