Skip to content

value-enabled-web/vew-api

Repository files navigation

👨‍🔬 vew-api

An experimental API for the Value-Enabled Web (VEW).

How to Run

You need a somewhat recent version of Node.js to run this.

  • npm install; then

  • npm run dev to run with hot reloading; or

  • npm start to run without hot reloading

The APIs will be served on port 3000.

API

GET /upcycle?url=<url>

Fetches and parses an article into readable VEW format.

Returns

For a successful query, a JSON object like this:

{
  "id": "<...>", // normalized article url,
  "content": "<...>" // readable article markdown,
  "paymentInfo": {
    "type": "<...>", // e.g. "lnAddress"
    "value": "<...>"
  }
  "_data": { // non standardized data
    "title": "<...>", // article title
    "html": "<...>", // cleaned article html
  }
}

If an error occurs, a JSON object like this:

{
  "error": "<...>" // description of the error
}