letsvalidate / api

API that uncovers the technologies used on websites and generates thumbnail from screenshot of website
https://pro.letsvalidate.com
196 stars 11 forks source link

Add option to prettify JSON output #1

Closed ghost closed 7 years ago

ghost commented 7 years ago

First off, this thing is pretty cool. Second, it would be awesome to have an option to output the JSON responses prettified.

So instead of just being able to receive:

{"url":"https://hackcabin.com/","originalUrl":"http://hackcabin.com","applications":[{"name":"Amazon Cloudfront","confidence":"100","version":"","icon":"Amazon-Cloudfront.svg","website":"http://aws.amazon.com/cloudfront/","categories":["CDN"]},{"name":"Amazon S3","confidence":"100","version":"","icon":"aws-s3.svg","website":"http://aws.amazon.com/s3/","categories":["Miscellaneous"]},{"name":"Google Analytics","confidence":"100","version":"UA","icon":"Google Analytics.svg","website":"http://google.com/analytics","categories":["Analytics"]},{"name":"Hugo","confidence":"100","version":"0.21","icon":"Hugo.png","website":"http://gohugo.io","categories":["CMS","Blogs"]}]}

We would be able to have returned from the API this with use of the option:

{
  "url": "https://hackcabin.com/",
  "originalUrl": "http://hackcabin.com",
  "applications": [
    {
      "name": "Amazon Cloudfront",
      "confidence": "100",
      "version": "",
      "icon": "Amazon-Cloudfront.svg",
      "website": "http://aws.amazon.com/cloudfront/",
      "categories": [
        "CDN"
      ]
    },
    {
      "name": "Amazon S3",
      "confidence": "100",
      "version": "",
      "icon": "aws-s3.svg",
      "website": "http://aws.amazon.com/s3/",
      "categories": [
        "Miscellaneous"
      ]
    },
    {
      "name": "Google Analytics",
      "confidence": "100",
      "version": "UA",
      "icon": "Google Analytics.svg",
      "website": "http://google.com/analytics",
      "categories": [
        "Analytics"
      ]
    },
    {
      "name": "Hugo",
      "confidence": "100",
      "version": "0.21",
      "icon": "Hugo.png",
      "website": "http://gohugo.io",
      "categories": [
        "CMS",
        "Blogs"
      ]
    }
  ]
}
hbakhtiyor commented 7 years ago

hi @jhabdas, thanks for your kind words :)

just added and deployed to prod, now you can use with prettify option which accepts all valid boolean values, yes, on, 1, true

e.g.

https://api.letsvalidate.com/v1/technologies?url=hackcabin.com&prettify=1
hbakhtiyor commented 7 years ago

also updated the doc, thanks again

hbakhtiyor commented 7 years ago

btw, please don't forget to share our api :tada:

ghost commented 7 years ago

consider it done! https://www.linkedin.com/hp/update/6274452145756569600