{
    "swagger": "2.0",
    "info": {
        "description": "Currents API Endpoint",
        "version": "1.0.0",
        "title": "Currents API Format",
        "termsOfService": "https://currentsapi.services/terms",
        "contact": {
            "email": "hi@currentsapi.services"
        }
    },
    "host": "api.currentsapi.services",
    "basePath": "/v1",
    "tags": [
        {
            "name": "endpoint",
            "description": "Currents API Endpoint",
            "externalDocs": {
                "description": "Find out more",
                "url": "https://currentsapi.services/docs"
            }
        }
    ],
    "schemes": [
        "https"
    ],
    "paths": {
        "/search": {
            "get": {
                "tags": [
                    "endpoint"
                ],
                "summary": "Search query results",
                "description": "",
                "operationId": "search",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "name": "language",
                        "in": "query",
                        "description": "Language values that need to be considered for filter",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "keywords",
                        "in": "query",
                        "description": "Keyword values that need to be considered for filter",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "description": "Country values that need to be considered for filter",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "description": "Category values that need to be considered for filter",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Starting Date format should follow : YYYY-MM-DDTHH:MM:SS+00:00",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End Date format should follow : YYYY-MM-DDTHH:MM:SS+00:00",
                        "required": false,
                        "type": "string"
                    }
                ],
                "security": {
                    "APIKeyHeader": []
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "type": "object",
                            "items": {
                                "$ref": "#/definitions/News"
                            },
                            "example": {
                                "status": "ok",
                                "news": [
                                    {
                                        "id": "ac4062d1-5fbb-4784-bf1d-6b50f5f643a0",
                                        "title": "Tulevaisuustutkija Markku Wilenius tiet\u00e4\u00e4, ett\u00e4 10 vuoden p\u00e4\u00e4st\u00e4 el\u00e4mme t\u00e4ysin erilaisessa maailmassa: \"Suuri her\u00e4\u00e4minen on selv\u00e4sti tapahtumassa\"",
                                        "description": "El\u00e4m\u00e4 on t\u00e4h\u00e4n saakka py\u00f6rinyt perustarpeiden ymp\u00e4rill\u00e4. Meille on riitt\u00e4nyt, ett\u00e4 suuhun on saanut sy\u00f6t\u00e4v\u00e4\u00e4, on ollut paikka miss\u00e4 asua, puoliso, kavereita ja mahdollisuus hiukan toteuttaa itse\u00e4\u00e4n.\nT...",
                                        "url": "https://yle.fi/uutiset/3-10905769?origin=rss",
                                        "author": "yle",
                                        "image": "//images.cdn.yle.fi/image/upload/w_960,h_640/13-3-10906278.jpg",
                                        "language": "fi",
                                        "category": [
                                            "general"
                                        ],
                                        "published": "2019-08-04 14:22:08 +0000"
                                    },
                                    {
                                        "id": "713f0c68-9bac-4168-9880-c94eecaf735f",
                                        "title": "Tubettaja muuttaa vuodeksi Sodankyl\u00e4\u00e4n ja markkinoi kuntaa somessaan \u2013 2\u00a0500 euron kuukausipalkka her\u00e4tt\u00e4nyt n\u00e4r\u00e4\u00e4 kuntalaisissa",
                                        "description": "Kunnissa tiedostetaan, kuinka t\u00e4rke\u00e4\u00e4 oikeiden mielikuvien luominen on, kun yritet\u00e4\u00e4n houkutella uusia asukkaita\nMuuttoliike suuntautuu useimmin maalta kaupunkiin kuin toisin p\u00e4in. Kaupunkilaista Fern...",
                                        "url": "https://yle.fi/uutiset/3-10908157?origin=rss",
                                        "author": "yle",
                                        "image": "None",
                                        "language": "fi",
                                        "category": [
                                            "general"
                                        ],
                                        "published": "2019-08-04 14:22:08 +0000"
                                    }
                                ]
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized access"
                    },
                    "429": {
                        "description": "Token limit reached"
                    }
                }
            }
        },
        "/latest-news": {
            "get": {
                "tags": [
                    "endpoint"
                ],
                "summary": "Get the latest news by language",
                "description": "Multiple status values can be provided with comma separated strings",
                "operationId": "getLatestNews",
                "produces": [
                    "application/json"
                ],
                "security": {
                    "APIKeyHeader": []
                },
                "parameters": [
                    {
                        "name": "language",
                        "in": "query",
                        "description": "Status values that need to be considered for filter",
                        "required": false,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "type": "object",
                            "items": {
                                "$ref": "#/definitions/News"
                            },
                            "example": {
                                "status": "ok",
                                "news": [
                                    {
                                        "id": "ac4062d1-5fbb-4784-bf1d-6b50f5f643a0",
                                        "title": "Tulevaisuustutkija Markku Wilenius tiet\u00e4\u00e4, ett\u00e4 10 vuoden p\u00e4\u00e4st\u00e4 el\u00e4mme t\u00e4ysin erilaisessa maailmassa: \"Suuri her\u00e4\u00e4minen on selv\u00e4sti tapahtumassa\"",
                                        "description": "El\u00e4m\u00e4 on t\u00e4h\u00e4n saakka py\u00f6rinyt perustarpeiden ymp\u00e4rill\u00e4. Meille on riitt\u00e4nyt, ett\u00e4 suuhun on saanut sy\u00f6t\u00e4v\u00e4\u00e4, on ollut paikka miss\u00e4 asua, puoliso, kavereita ja mahdollisuus hiukan toteuttaa itse\u00e4\u00e4n.\nT...",
                                        "url": "https://yle.fi/uutiset/3-10905769?origin=rss",
                                        "author": "yle",
                                        "image": "//images.cdn.yle.fi/image/upload/w_960,h_640/13-3-10906278.jpg",
                                        "language": "fi",
                                        "category": [
                                            "general"
                                        ],
                                        "published": "2019-08-04 14:22:08 +0000"
                                    },
                                    {
                                        "id": "713f0c68-9bac-4168-9880-c94eecaf735f",
                                        "title": "Tubettaja muuttaa vuodeksi Sodankyl\u00e4\u00e4n ja markkinoi kuntaa somessaan \u2013 2\u00a0500 euron kuukausipalkka her\u00e4tt\u00e4nyt n\u00e4r\u00e4\u00e4 kuntalaisissa",
                                        "description": "Kunnissa tiedostetaan, kuinka t\u00e4rke\u00e4\u00e4 oikeiden mielikuvien luominen on, kun yritet\u00e4\u00e4n houkutella uusia asukkaita\nMuuttoliike suuntautuu useimmin maalta kaupunkiin kuin toisin p\u00e4in. Kaupunkilaista Fern...",
                                        "url": "https://yle.fi/uutiset/3-10908157?origin=rss",
                                        "author": "yle",
                                        "image": "None",
                                        "language": "fi",
                                        "category": [
                                            "general"
                                        ],
                                        "published": "2019-08-04 14:22:08 +0000"
                                    }
                                ]
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized access"
                    },
                    "429": {
                        "description": "Token limit reached"
                    }
                }
            }
        },
        "/available/languages": {
            "get": {
                "tags": [
                    "endpoint"
                ],
                "summary": "Valid language code",
                "description": "Obtain valid language code",
                "operationId": "languages",
                "produces": [
                    "application/json"
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "type": "object",
                            "example": {
                                "languages": {
                                    "Arabic": "ar",
                                    "Chinese": "zh",
                                    "Dutch": "nl",
                                    "English": "en",
                                    "Finnish": "fi",
                                    "French": "fr",
                                    "German": "de",
                                    "Hindi": "hi",
                                    "Italian": "it",
                                    "Japanese": "ja",
                                    "Korean": "ko",
                                    "Malay": "msa",
                                    "Portuguese": "pt",
                                    "Russian": "ru",
                                    "Spanish": "es"
                                },
                                "description": "available languages followed by query code",
                                "status": "ok"
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized access"
                    },
                    "429": {
                        "description": "Token limit reached"
                    }
                }
            }
        },
        "/available/regions": {
            "get": {
                "tags": [
                    "endpoint"
                ],
                "summary": "Valid country region code",
                "description": "Obtain valid region code",
                "produces": [
                    "application/json"
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "type": "object",
                            "example": {
                                "regions": {
                                    "Australia": "AS",
                                    "": "PSE",
                                    "Canada": "CA",
                                    "China": "CN",
                                    "Finland": "FI",
                                    "South Korea": "SK",
                                    "Taiwan": "TW",
                                    "Thailand": "TH",
                                    "Vietnam": "VIET",
                                    "United State": "US",
                                    "German": "GB",
                                    "Zimbabwe": "ZW",
                                    "Italy": "IT"
                                },
                                "description": "available regions followed by query code",
                                "status": "ok"
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized access"
                    },
                    "429": {
                        "description": "Token limit reached"
                    }
                }
            }
        },
        "/available/categories": {
            "get": {
                "tags": [
                    "endpoint"
                ],
                "summary": "Valid country region code",
                "description": "Obtain valid region code",
                "produces": [
                    "application/json"
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "type": "object",
                            "example": {
                                "categories": [
                                    "regional",
                                    "technology",
                                    "lifestyle",
                                    "business",
                                    "general",
                                    "programming",
                                    "science",
                                    "entertainment",
                                    "world",
                                    "sports",
                                    "finance",
                                    "academia",
                                    "politics",
                                    "health",
                                    "opinion",
                                    "food",
                                    "game"
                                ],
                                "description": "order by source count in descending order",
                                "status": "ok"
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized access"
                    },
                    "429": {
                        "description": "Token limit reached"
                    }
                }
            }
        }
    },
    "securityDefinitions": {
        "ApiKeyAuth": {
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        }
    },
    "definitions": {
        "Results": {
            "type": "object",
            "xml": {
                "name": "Results"
            },
            "properties": {
                "status": {
                    "type": "string",
                    "example": "ok",
                    "enum": [
                        "ok",
                        "error"
                    ]
                },
                "news": {
                    "type": "array",
                    "xml": {
                        "name": "category",
                        "wrapped": true
                    },
                    "items": {
                        "$ref": "#/definitions/News"
                    }
                }
            }
        },
        "Tag": {
            "type": "string",
            "xml": {
                "name": "Tag"
            }
        },
        "News": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "format": "uuid"
                },
                "title": {
                    "type": "string",
                    "example": "Investors are taking a gamble on Bitcoin"
                },
                "urls": {
                    "type": "string",
                    "xml": {
                        "name": "linkUrl",
                        "wrapped": true
                    },
                    "items": {
                        "type": "string"
                    }
                },
                "category": {
                    "type": "array",
                    "xml": {
                        "name": "category",
                        "wrapped": true
                    },
                    "items": {
                        "$ref": "#/definitions/Tag"
                    }
                },
                "description": {
                    "type": "string",
                    "description": "description of the news"
                },
                "image": {
                    "type": "string",
                    "description": "link to image urls"
                },
                "published": {
                    "type": "string",
                    "description": "date string format"
                }
            },
            "xml": {
                "name": "News"
            }
        },
        "ApiResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer",
                    "format": "int32"
                },
                "type": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        }
    },
    "externalDocs": {
        "description": "Find out more about Swagger",
        "url": "http://swagger.io"
    }
}