d3an / finviz

Go API for Finviz
https://github.com/d3an/finviz/wiki
MIT License
20 stars 3 forks source link

Change JSON output format to have ticker primary keys #47

Open d3an opened 4 years ago

d3an commented 4 years ago

Ex.

[
  {
    "A": {
      "Avg Volume": "1.47M",
      "Change": "0.00%",
      "No.": 1,
      "Perf Half": "28.54%",
      "Perf Month": "6.04%",
      "Perf Quart": "13.47%",
      "Perf Week": "4.12%",
      "Perf YTD": "21.23%",
      "Perf Year": "45.95%",
      "Price": 103.42,
      "Recom": "2.40",
      "Rel Volume": 0.97,
      "Ticker": "A",
      "Volatility M": "1.80%",
      "Volatility W": "1.82%",
      "Volume": 0
    },
    "AA": {
      "Avg Volume": "7.33M",
      "Change": "0.00%",
      "No.": 2,
      "Perf Half": "23.38%",
      "Perf Month": "7.32%",
      "Perf Quart": "26.03%",
      "Perf Week": "-2.65%",
      "Perf YTD": "-31.80%",
      "Perf Year": "-19.75%",
      "Price": 14.67,
      "Recom": "2.70",
      "Rel Volume": 0.77,
      "Ticker": "AA",
      "Volatility M": "4.72%",
      "Volatility W": "4.12%",
      "Volume": 0
    }
  }
]

instead of

[
  {
    "Avg Volume": "1.47M",
    "Change": "0.00%",
    "No.": 1,
    "Perf Half": "28.54%",
    "Perf Month": "6.04%",
    "Perf Quart": "13.47%",
    "Perf Week": "4.12%",
    "Perf YTD": "21.23%",
    "Perf Year": "45.95%",
    "Price": 103.42,
    "Recom": "2.40",
    "Rel Volume": 0.97,
    "Ticker": "A",
    "Volatility M": "1.80%",
    "Volatility W": "1.82%",
    "Volume": 0
  },
  {
    "Avg Volume": "7.33M",
    "Change": "0.00%",
    "No.": 2,
    "Perf Half": "23.38%",
    "Perf Month": "7.32%",
    "Perf Quart": "26.03%",
    "Perf Week": "-2.65%",
    "Perf YTD": "-31.80%",
    "Perf Year": "-19.75%",
    "Price": 14.67,
    "Recom": "2.70",
    "Rel Volume": 0.77,
    "Ticker": "AA",
    "Volatility M": "4.72%",
    "Volatility W": "4.12%",
    "Volume": 0
  }
]
d3an commented 2 years ago

Research whether or not this is a good idea.

cksidharthan commented 1 year ago

are you still looking for help with this change? If yes, I can help :)