Skip to content
phw edited this page Feb 22, 2013 · 6 revisions

GET /topics

Request: GET /topics

Returns a collection of all topic areas supported by TEXTKING. This endpoint is public and does not require authorization.

Query parameters

Parameter Description
per_page An integer value defining how many entries should be returned. Only values between 1 and 100 (both inclusive) are allowed. If not given, this defaults to 100.
page Return search results starting at a given page. Used for paging through more than one page of results.

Request headers

Header Description
Accept application/json or application/xml
Accept-Language The language in which the localized topic names are returned. Currently the API supports de and en as valid language codes.

Response status codes

HTTP status Description
200 Ok Successful request.

Example

Load the first 5 topic areas in German:

GET /v1/topics?per_page=5 HTTP/1.1
Host: api.textking.com
Accept: application/json
Accept-Language: de

Response:

HTTP/1.1 200 Ok
Content-Type: application/json; charset=utf-8
Content-Language: de

{
    "page": 1,
    "per_page": 5,
    "total": 15,
    "items": [
        {
            "id": "49353ab0-fdbf-4e1c-a063-cdf4aad98782",
            "name": "Allgemein",
            "localization_language": "de",
            "links": [
                {
                    "rel": "self",
                    "href": "https://api.textking.com/v1/topic/49353ab0-fdbf-4e1c-a063-cdf4aad98782"
                }
            ]
        },
        {
            "id": "c68cd090-a5ae-4b5e-b514-f70046177844",
            "name": "Bauwesen, Immobilien",
            "localization_language": "de",
            "links": [
                {
                    "rel": "self",
                    "href": "https://api.textking.com/v1/topic/c68cd090-a5ae-4b5e-b514-f70046177844"
                }
            ]
        },
        {
            "id": "3f8067b4-d859-4c24-a1ba-ad13eeade3ab",
            "name": "Finanzen",
            "localization_language": "de",
            "links": [
                {
                    "rel": "self",
                    "href": "https://api.textking.com/v1/topic/3f8067b4-d859-4c24-a1ba-ad13eeade3ab"
                }
            ]
        },
        {
            "id": "23e59a46-2937-4800-ae0a-5a61b33bca6e",
            "name": "Kunst / Kultur",
            "localization_language": "de",
            "links": [
                {
                    "rel": "self",
                    "href": "https://api.textking.com/v1/topic/23e59a46-2937-4800-ae0a-5a61b33bca6e"
                }
            ]
        },
        {
            "id": "7926b2ad-3215-4a8d-82a9-977ed15615a8",
            "name": "Marketing",
            "localization_language": "de",
            "links": [
                {
                    "rel": "self",
                    "href": "https://api.textking.com/v1/topic/7926b2ad-3215-4a8d-82a9-977ed15615a8"
                }
            ]
        }
    ],
    "links": [
        {
            "rel": "self",
            "href": "https://api.textking.com/v1/topics?page=1&per_page=5"
        },
        {
            "rel": "next",
            "href": "https://api.textking.com/v1/topics?page=2&per_page=5"
        }
    ]
}