Skip to content

stg7/webapis

Repository files navigation

webapis

[TOC]

authors:

stg7@gmx.de

About

A few web api tools for search request to different webservices. All request will be cached, therefore server traffic is reduced.

First Start

For some of the webservices you need API keys, that were configured in api_keys.json or can be setted in each instance with set_api_key(KEY)

The easy way is to create the api_keys.json file with the following content, you can use api_keys.json.example:

{
    "freebase": "KEY",
    "chatnoir2": "dev",
    "chatnoir": "KEY"
}

Webservices

Example run

Just call:

./example.py hello world

and you will get something like:

wikidata
{
    "search": [
        {
            "id": "Q2471943",
            "label": "Hello World",
            "match": {
                "language": "en",
                "text": "Hello World",
                "type": "label"
            },
            "url": "//www.wikidata.org/wiki/Q2471943"
        },
        .....
    ],
    "searchinfo": {
        "search": "hello world"
    },
    "success": 1
}
querysegmentation
{
    "hyb-a": "hello|world",
    "hyb-b": "hello|world",
    "hyb-i": "hello|world",
    "naive": "hello|world",
    "wiki-based": "hello|world",
    "wt-baseline": "hello|world",
    "wt-snp-baseline": "hello|world"
}
google
[
    {
        "link": "https://de.wikipedia.org/wiki/Hallo-Welt-Programm&sa=U&ved=0CBQQFjAAahUKEwjBjJnCvrfHAhVJNxQKHf-8BMs&usg=AFQjCNEC-7j-QshsfJN5sDttc_1DtYuIKw\"",
        "title": "Hallo-Welt-Programm  Wikipedia"
    },
    ...
]

as output.

About

a few web api tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages