A
A
Andrey Petrov2018-06-20 07:17:34
API
Andrey Petrov, 2018-06-20 07:17:34

How to connect an external API to the site?

Hello! I do not know how to connect an external API and display information from it on the site. Website in HTML. I do everything myself, but I don’t know programming ...
There is a link to an external API
There is an example of a Json response

{
  "data": [
       {
      "id": 3,
      "title": "Сбербанк ао",
      "tiker": "SBER",
      "price": 160.5600000000,
      "change": -3.56347,
      "logoURL": "/img/storestocks/shop/3.png",
      "lotSize": 10,
      "typeId": 1,
      "available": 1,
      "minLots": 2,
      "maxLots": 186,
      "chpu": "moex-akcii/sberbank"
    },
  ],
  "error": {
    "msg": "",
    "code": ""
  },
  "status": true

}

I understand that the link is connected like this:
<script src="ссылка на API"></script>
And here's how to write down the answer and display now. If I understand correctly, then you need to create a div with some kind of any identifier or class, and run it in this div through the script.
How to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Matvey Pravosudov, 2018-06-20
@NE-PROGRAMIST

I understand that the link is connected like this:

No, it doesn't connect like that. This URL is needed in order to send requests to it ( using the GET method ), receive a response in JSON, and then use this response on your site.
Read:
  • Beginner's Guide to HTTP and REST
  • Beginners guide to creating a REST API

A
Andrey Petrov, 2018-06-20
@NE-PROGRAMIST

Roman, I think there are the necessary settings, since they give this API. It is for this purpose that it is intended to display information on the online store of the Finam broker on third-party sites, for partners. Okay, I think I should leave it for now. I will study a little, when I begin to understand more, then I will do everything. Or money will appear, it is easier for a freelancer to give an order.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question