Catch Json data and save it

Good day, everyone!

would like to ask for an advice, on which languages/topics i should learn if I want to make my project, and learn in same time.

Our company has service that sends data in Json format for clients, and they “catch” the data and store in their DB.

just as an example, they use php code similar to this:

<?php
$url = "https://site.com/client1/";

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$data = <<<DATA
{
  "Id": 78912,
  "Customer": "customer1",
  "Quantity": 1,
  "Price": 18.00
}
DATA;

curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

$resp = curl_exec($curl);
curl_close($curl);

echo $resp;
?>

Would like to learn how to cath this data and use it, put it in db and make charts, sort by quantity, date, etc.

Tried searching online, but there is a lot of different pages and information, but if my second page is php it seems to work only if i keep updating the page same time when the data is being sent, and it should work even if the site is not opened.

Maybe you could guide me in right side. I don’t need the code, I need the language/languages/information to learn it myself.

Thank you!

First off, lots and lots of languages can let you capture that data. It’s all information retrieved from an API in a readily usable format called JSON. You can use Python, Javascript , C#, Java, and some others I can’t name off the top of my head.

As for putting it into a database, again, lots of different languages let you open up a connection to a database and store it. It really depends on what languages feel most comfortable to you.

To make the charts, you could export to a CSV file format and open that up in your favorite spreadsheet program. If that’s not what you’re after, you could follow the Data Analysis course FreeCodeCamp has to offer.

P.S I would look into the http-client library in Python to make requests, and the json library to parse it.

1 Like

Thank you so much,

sometime it’s just too much information and it gets confusing. Glad to found this community.

Going to start Javascript/Python and read about JSON.