Skip to content

An API exposing web pages are pure data (GraphQL + JSON)

Notifications You must be signed in to change notification settings

owainlewis/webquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Query

An API exposing web pages are pure data (GraphQL + JSON)

API

A simple API allows you to pull data from web pages with a simple query language.

To get all the stories from Hacker News

POST /api/v1/query \
-H 'Content-Type: application/json' \
-d '{"uri": "https://news.ycombinator.com", "selector": ".storylink"}"'

Which will return

{
   "elements":[
      {
         "tag":"a",
         "text":"How the Dat Protocol Works",
         "attributes":{
            "href":"https://datprotocol.github.io/how-dat-works/",
            "class":"storylink"
         }
      },
      {
         "tag":"a",
         "text":"Understanding Kafka with Factorio",
         "attributes":{
            "href":"https://hackernoon.com/understanding-kafka-with-factorio-74e8fc9bf181",
            "class":"storylink"
         }
      }
   ]
}

About

An API exposing web pages are pure data (GraphQL + JSON)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published