All Projects → pari08tosh → Inshorts-API

pari08tosh / Inshorts-API

Licence: MIT License
An Inshorts API which provides news for different categories from the Inshorts Website. Built using Flask and Beautiful Soup.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Inshorts-API

newspaper3 usage overview
This repository provides usage examples for the Python module Newspaper3k.
Stars: ✭ 78 (+73.33%)
Mutual labels:  news, beautifulsoup
Scraper-Projects
🕸 List of mini projects that involve web scraping 🕸
Stars: ✭ 25 (-44.44%)
Mutual labels:  beautifulsoup
bullshit-detector
🔍 Chráňte vašich blízkych pred nedôveryhodným 🇸🇰 a 🇨🇿 obsahom
Stars: ✭ 24 (-46.67%)
Mutual labels:  news
pipeline
The Polytechnic's content management system
Stars: ✭ 17 (-62.22%)
Mutual labels:  news
golangflow
GolangFlow.io Website
Stars: ✭ 37 (-17.78%)
Mutual labels:  news
newsemble
API for fetching data from news websites.
Stars: ✭ 42 (-6.67%)
Mutual labels:  news
feedIO
A Feed Aggregator that Knows What You Want to Read.
Stars: ✭ 26 (-42.22%)
Mutual labels:  news
kick-off-web-scraping-python-selenium-beautifulsoup
A tutorial-based introduction to web scraping with Python.
Stars: ✭ 18 (-60%)
Mutual labels:  beautifulsoup
apple-news
A Node.js client for interacting with the Apple News API 📰
Stars: ✭ 34 (-24.44%)
Mutual labels:  news
SJS DROPS
Script using requests module to register accounts to Slam Jam Socialism raffles.
Stars: ✭ 21 (-53.33%)
Mutual labels:  beautifulsoup
doto
Let's try something different
Stars: ✭ 78 (+73.33%)
Mutual labels:  news
overflow-news
📚 Don't waste time searching for good dev blog posts. Get the latest news here.
Stars: ✭ 32 (-28.89%)
Mutual labels:  news
pynytimes
Use all the New York Times APIs in Python!
Stars: ✭ 22 (-51.11%)
Mutual labels:  news
TrollHunter
Twitter Troll & Fake News Hunter - Crawls news websites and twitter to identify fake news
Stars: ✭ 38 (-15.56%)
Mutual labels:  news
CryptoBuddy
Android app which displays cryptocurrency prices, charts and news!
Stars: ✭ 93 (+106.67%)
Mutual labels:  news
dac
Entity linker for the newspaper collection of the National Library of the Netherlands. Links named entity mentions to DBpedia descriptions using either a binary SVM classifier or a neural net.
Stars: ✭ 14 (-68.89%)
Mutual labels:  news
lobsters-reader
iOS app for reading Lobste.rs.
Stars: ✭ 15 (-66.67%)
Mutual labels:  news
Giveme5W
Extraction of the five journalistic W-questions (5W) from news articles
Stars: ✭ 16 (-64.44%)
Mutual labels:  news
News
News application with 66 providers
Stars: ✭ 18 (-60%)
Mutual labels:  news
Fake-News-Detection-Project
Fake News Detection Final Year College Project with Project Report, PPT, Code, Research Paper and Documents.
Stars: ✭ 16 (-64.44%)
Mutual labels:  news

Inshorts API

Inshorts is an app which provides news from different sources and presents them under 60 words. This API Scraps content from the Inshorts website and provides it in easy to use JSON Format.

Categories

Supports all categories as on the Inshorts Website. These include -

  1. '' // blank to get top news from all categories
  2. national //Indian National News
  3. business
  4. sports
  5. world
  6. politics
  7. technology
  8. startup
  9. entertainment
  10. miscellaneous
  11. hatke // Unconventional
  12. science
  13. automobile

Usage

1. GET Request

Make a get request of the form

http://{site_address}/news?category={category_name}

Example - http://www.exampleapi.com/news?category=science

2. POST Request

Make a post request with the category, provided as form data with name 'category' to the same route as above i.e '/news'.

Response Format

The response JSON Object looks something like this -

{
    "category": "science",
    "data": [
        {
            "author": "Gaurav Shroff",
            "content": "NASA-backed Starlight program has selected tardigrades and a roundworm species as Earth's first interstellar voyagers who would exit the solar system on a laser-powered spacecraft. Tardigrades, also called water bears, are regarded as the most resilient life forms on Earth. The eight-legged micro-animal can survive for 30 years without food or water and endure temperatures from -270ºC to 150ºC.",
            "date": "04 Nov 2017,Saturday",
            "imageUrl": "http://images.newsinshorts.com.edgesuite.net/app_assets/images/2017/4nov/inshorts_image_1509767709444_984.jpg?resize=400px:*",
            "readMoreUrl": "http://www.deepspace.ucsb.edu/projects/ets?utm_source=inshorts&utm_medium=referral&utm_campaign=fullarticle ",
            "time": "12:38 pm",
            "title": "\nTardigrades selected among 1st species to leave solar system\n",
            "url": "https://www.inshorts.com/en/news/tardigrades-selected-among-1st-species-to-leave-solar-system-1509779328721"
        },
        {
            "author": "Gaurav Shroff",
            "content": "India, with the launch of ₹450-crore Mangalyaan mission on November 5, 2013, became the only country to reach the Martian orbit on its maiden voyage. Mangalyaan, also Asia's first successful Mars mission, recently completed three years in orbit despite being designed to last just six months. Notably, only 21 of the 51 previous attempts to reach Mars were successful.",
            "date": "05 Nov 2017,Sunday",
            "imageUrl": "http://images.newsinshorts.com.edgesuite.net/app_assets/images/2017/5nov/inshorts_image_1509863191507_302.jpg?resize=400px:*",
            "readMoreUrl": "https://www.theverge.com/2014/9/24/6837745/india-spacecraft-reaches-mars-orbit-less-than-gravity?utm_source=inshorts&utm_medium=referral&utm_campaign=fullarticle ",
            "time": "12:49 pm",
            "title": "\nIndia's Mangalyaan only mission to reach Mars in 1st attempt\n",
            "url": "https://www.inshorts.com/en/news/indias-mangalyaan-only-mission-to-reach-mars-in-1st-attempt-1509866348359"
        },
    ],
    "success": true
}

Each response object has the following keys -

  1. success - true indicates the api ran successfully. Upon error the success value is false and the object includes an errorMessage key with the error message.

    {
        "category": "sciencedfg",
        "data": [],
        "errorMessage": "Invalid Category",
        "success": false
    }
  2. category - the category you requested for.

  3. data - An array of objects each containing a news item for the category. Each object contains

    • title
    • content
    • author
    • imageUrl
    • readMoreUrl(link to original news article)
    • date and time of publish
    • url (link to inshorts page)

Installation and Setup

All dependencies are listed in requirements.txt file.

  1. To install all dependencies run -

    $ sudo pip freeze -r requirements.txt
  2. Start the api server

    $ python app.py
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].