import http.client
import json

from config import headers

url = 'bing-news-search1.p.rapidapi.com'


def fetch_news():
    connection = http.client.HTTPSConnection(url)
    connection.request("GET", "/news/search?q=btc&safeSearch=Off&textFormat=Raw&originalImg=true&freshness=Day",
                       headers=headers)

    res = connection.getresponse()
    data = res.read()
    data = data.decode('utf-8')
    data = json.loads(data)

    return data

8ce45d2a40e4ab6fb88c36eb3be2788f75ca1d21
<mask token>

<mask token>


def fetch_news():
    connection = http.client.HTTPSConnection(url)
    connection.request('GET',
        '/news/search?q=btc&safeSearch=Off&textFormat=Raw&originalImg=true&freshness=Day'
        , headers=headers)
    res = connection.getresponse()
    data = res.read()
    data = data.decode('utf-8')
    data = json.loads(data)
    return data

<mask token>
url = 'bing-news-search1.p.rapidapi.com'


def fetch_news():
    connection = http.client.HTTPSConnection(url)
    connection.request('GET',
        '/news/search?q=btc&safeSearch=Off&textFormat=Raw&originalImg=true&freshness=Day'
        , headers=headers)
    res = connection.getresponse()
    data = res.read()
    data = data.decode('utf-8')
    data = json.loads(data)
    return data

import http.client
import json
from config import headers
url = 'bing-news-search1.p.rapidapi.com'


def fetch_news():
    connection = http.client.HTTPSConnection(url)
    connection.request('GET',
        '/news/search?q=btc&safeSearch=Off&textFormat=Raw&originalImg=true&freshness=Day'
        , headers=headers)
    res = connection.getresponse()
    data = res.read()
    data = data.decode('utf-8')
    data = json.loads(data)
    return data

import http.client
import json

from config import headers

url = 'bing-news-search1.p.rapidapi.com'


def fetch_news():
    connection = http.client.HTTPSConnection(url)
    connection.request("GET", "/news/search?q=btc&safeSearch=Off&textFormat=Raw&originalImg=true&freshness=Day",
                       headers=headers)

    res = connection.getresponse()
    data = res.read()
    data = data.decode('utf-8')
    data = json.loads(data)

    return data
