Make encrypted requests to MyVariant.info API via https

myvariant.info api http https

Previously, MyVariant.info API only supported the standard http protocol, hence all data between the clients and our servers are not encrypted. Although Http protocol is widely used and is sufficient for most applications, a higher level of security may be needed for certain uses (e.g. handling sensitive patient data). Https protocol was specifically designed for such purpose. With https, the communication between clients and servers are always encrypted using secure protocols like SSL (Secure Sockets Layer) or TLS (Transport Layer Security) (read more about http vs https).

We are happy to announce that our MyVariant.info API now supports both http and https protocols. Switching to use http is easy. You just need to replace http in your query URL with https. For example, in our Python client, myvariant:

In [1]: import myvariant

In [2]: mv = myvariant.MyVariantInfo()

In [3]: mv.url
Out[3]: 'http://myvariant.info/v1'

In [4]: mv.url = 'https://myvariant.info/v1'
# now the follow queries will be made via https

Here are examples of both http and https requests, and they should return the same results:

  • Regular http request without encryption:
GET http://myvariant.info/v1/query?q=dbnsfp.genename:BTK&fields=dbnsfp.sift

HTTP/1.1 200 OK
Content-Length: 476
Content-Type: application/json; charset=UTF-8

{
    "hits": [
        {
            "_id": "chrX:g.100604898A>T",
            "_score": 12.220982,
            "dbnsfp": {
                "sift": {
                    "converted_rankscore": 0.2202,
                    "pred": [
                        ".",
                        "T",
                        "T"
                    ],
                    "score": [
                        null,
                        0.179,
                        0.601
                    ]
                }
            }
        },
        ...
    ], 
    "max_score": 12.220982, 
    "took": 4, 
    "total": 5143
}

  • https request with encryption:
GET https://myvariant.info/v1/query?q=dbnsfp.genename:BTK&fields=dbnsfp.sift

HTTP/1.1 200 OK
Content-Length: 476
Content-Type: application/json; charset=UTF-8

{
    "hits": [
        {
            "_id": "chrX:g.100604898A>T",
            "_score": 12.220982,
            "dbnsfp": {
                "sift": {
                    "converted_rankscore": 0.2202,
                    "pred": [
                        ".",
                        "T",
                        "T"
                    ],
                    "score": [
                        null,
                        0.179,
                        0.601
                    ]
                }
            }
        },
        ...
    ], 
    "max_score": 12.220982, 
    "took": 4, 
    "total": 5143
}

Enjoy!

(And as a side note, our MyGene.info API has already supported both http and https quite a while ago.)