curl https://financialmodelingprep.com/api/v3/profile/AAPL
[ {
"symbol" : "AAPL",
"price" : 145.85,
"beta" : 1.201965,
"volAvg" : 79766736,
"mktCap" : 2410929717248,
"lastDiv" : 0.85,
"range" : "105.0-157.26",
"changes" : 2.4200134,
"companyName" : "Apple Inc.",
"currency" : "USD",
"cik" : "0000320193",
"isin" : "US0378331005",
"cusip" : "037833100",
"exchange" : "Nasdaq Global Select",
"exchangeShortName" : "NASDAQ",
"industry" : "Consumer Electronics",
"website" : "http://www.apple.com",
"description" : "Apple Inc. designs, manufactures, and markets smartphones, personal computers, tablets, wearables, and accessories worldwide. It also sells various related services. The company offers iPhone, a line of smartphones; Mac, a line of personal computers; iPad, a line of multi-purpose tablets; and wearables, home, and accessories comprising AirPods, Apple TV, Apple Watch, Beats products, HomePod, iPod touch, and other Apple-branded and third-party accessories. It also provides AppleCare support services; cloud services store services; and operates various platforms, including the App Store, that allow customers to discover and download applications and digital content, such as books, music, video, games, and podcasts. In addition, the company offers various services, such as Apple Arcade, a game subscription service; Apple Music, which offers users a curated listening experience with on-demand radio stations; Apple News+, a subscription news and magazine service; Apple TV+, which offers exclusive original content; Apple Card, a co-branded credit card; and Apple Pay, a cashless payment service, as well as licenses its intellectual property. The company serves consumers, and small and mid-sized businesses; and the education, enterprise, and government markets. It sells and delivers third-party applications for its products through the App Store. The company also sells its products through its retail and online stores, and direct sales force; and third-party cellular network carriers, wholesalers, retailers, and resellers. Apple Inc. was founded in 1977 and is headquartered in Cupertino, California.",
"ceo" : "Mr. Timothy Cook",
"sector" : "Technology",
"country" : "US",
"fullTimeEmployees" : "147000",
"phone" : "14089961010",
"address" : "1 Apple Park Way",
"city" : "Cupertino",
"state" : "CALIFORNIA",
"zip" : "95014",
"dcfDiff" : 89.92,
"dcf" : 148.019,
"image" : "https://financialmodelingprep.com/image-stock/AAPL.png",
"ipoDate" : "1980-12-12",
"defaultImage" : false,
"isEtf" : false,
"isActivelyTrading" : true,
"isAdr" : false,
"isFund" : false
} ]
document.addEventListener('DOMContentLoaded', () => {
getRequest(
'',
drawOutput
);
function drawOutput(responseText) {
let resp = JSON.parse(responseText).financials;
let financials = resp;
let $table = document.createElement("table");
$table.className += " table";
var elements = document.querySelectorAll('.stock-name')[0];
let $head = document.createElement("thead");
let $body = document.createElement("tbody");
let $lineHader = document.createElement("tr");
/* let $elefirst = document.createElement("th");
$elefirst.textContent = 'Fiscal';
$lineHader.appendChild($elefirst); */
for (let i = 0; i < financials.length; i++) {
let financial = financials[i];
let $line = document.createElement("tr");
for (var key in financial) {
if (i === 0 && financial.hasOwnProperty(key)) {
let $ele = document.createElement("th");
$ele.textContent = key;
$lineHader.appendChild($ele);
}
}
$head.appendChild($lineHader);
$table.appendChild($head);
var z = 0;
for (var key2 in financial) {
if (financial.hasOwnProperty(key2)) {
/* if (z === 0) {
let title = Object.keys(resp)[i];
let $eleTile = document.createElement("td");
$eleTile.textContent = title;
$line.appendChild($eleTile);
} */
let $eletd = document.createElement("td");
if (z === 0) {
$eletd.textContent = financial[key2];
} else {
$eletd.textContent = financial[key2];
}
$line.appendChild($eletd);
}
z++;
}
$body.appendChild($line)
$table.appendChild($body);
}
document.body.appendChild($table);
}
function getRequest(url, success) {
var req = false;
try {
req = new XMLHttpRequest();
} catch (e) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
return false;
}
}
}
if (!req) return false;
if (typeof success != 'function') success = function() {};
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status === 200) {
success(req.responseText)
}
}
}
req.open("GET", url, true);
req.send(null);
return req;
}
})
$(document).ready(function() {
var url = "";
$.ajax({
url: url,
type: "GET",
crossDomain: true,
success: function(response) {
let resp = response;
let symbol = resp.symbol;
let financials = resp.financials;
let $table = $("<table class='table'></table>");
for (let i = 0; i < financials.length; i++) {
let financial = financials[i];
let $line = $("<tr></tr>");
let $lineHader = $("<tr></tr>");
let $head = $('<thead></thead>');
for (var key in financial) {
if (i === 0 && financial.hasOwnProperty(key)) {
$lineHader.append($("<th></th>").html(key));
}
}
$head.append($lineHader);
$table.append($head);
let z = 0;
for (var key2 in financial) {
if (financial.hasOwnProperty(key2)) {
if (z === 0) {
$line.append($("<td></td>").html(financial[key2]));
} else {
$line.append($("<td></td>").html('$' + financial[key2]));
}
z++;
}
}
$table.append($line);
}
$table.appendTo(document.body);
},
error: function(xhr, status) {
alert("error");
}
});
});
var app = new Vue({
el: "#app",
data: {
url: '",
financials: [],
loaded: false,
searchQuery: '',
stockName: 'Netflix'
},
created: function() {
var self = this
axios
.get(this.url)
.then((response) => {
this.financials = response.data.financials;
this.loaded = true;
})
.catch((error) => {
alert('error');
})
}
});
import {Component, OnInit, ViewChild} from '@angular/core';
import {MatPaginator, MatSort, MatTableDataSource} from '@angular/material';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'table-overview-example',
styleUrls: ['table-overview-example.css'],
templateUrl: 'table-overview-example.html',
})
export class TableOverviewExample implements OnInit {
loaded: boolean = false;
displayedColumns: string[] = [];
dataSource: MatTableDataSource<AnimationPlayState>;
url = '';
financialStatement: any = [];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
constructor(private http: HttpClient) {
this.http.get<any>(this.url).subscribe(data => {
this.financialStatement = data.financials;
this.createdDisplayComlumn(this.financialStatement[0]);
this.dataSource = new MatTableDataSource(this.financialStatement);
this.loaded =true;
})
}
ngOnInit() {
setTimeout(() => {
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
},1000);
}
applyFilter(filterValue: string) {
this.dataSource.filter = filterValue.trim().toLowerCase();
if (this.dataSource.paginator) {
this.dataSource.paginator.firstPage();
}
}
createdDisplayComlumn(obj) {
Object.keys(obj).forEach((key,index)=> {
this.displayedColumns.push(key);
});
}
}
URL url = new URL("");
try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"))) {
for (String line; (line = reader.readLine()) != null;) {
System.out.println(line);
}
}
set_time_limit(0);
$url_info = "";
$channel = curl_init();
curl_setopt($channel, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($channel, CURLOPT_HEADER, 0);
curl_setopt($channel, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($channel, CURLOPT_URL, $url_info);
curl_setopt($channel, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($channel, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($channel, CURLOPT_TIMEOUT, 0);
curl_setopt($channel, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($channel, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($channel, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = curl_exec($channel);
if (curl_error($channel)) {
return 'error:' . curl_error($channel);
} else {
$outputJSON = json_decode($output);
var_dump($outputJSON);
}
const https = require('https')
const options = {
hostname: 'financialmodelingprep.com',
port: 443,
path: '',
method: 'GET'
}
const req = https.request(options, (res) => {
res.on('data', (d) => {
process.stdout.write(d)
})
})
req.on('error', (error) => {
console.error(error)
})
req.end()
#!/usr/bin/env python
try:
# For Python 3.0 and later
from urllib.request import urlopen
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import urlopen
import certifi
import json
def get_jsonparsed_data(url):
"""
Receive the content of ``url``, parse it as JSON and return the object.
Parameters
----------
url : str
Returns
-------
dict
"""
response = urlopen(url, cafile=certifi.where())
data = response.read().decode("utf-8")
return json.loads(data)
url = ("")
print(get_jsonparsed_data(url))
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
url := ""
response, err := http.Get(url)
if err != nil {
log.Fatal(err)
}
defer response.Body.Close()
responseData, err := ioutil.ReadAll(response.Body)
if err != nil {
log.Fatal(err)
}
responseString := string(responseData)
fmt.Println(responseString)
}
require 'net/http'
require 'uri'
uri = URI.parse("")
request = Net::HTTP::Get.new(uri)
request["Upgrade-Insecure-Requests"] = "1"
req_options = {
use_ssl: uri.scheme == "https",
}
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
# response.code
# response.body
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("GET"), ""))
{
request.Headers.TryAddWithoutValidation("Upgrade-Insecure-Requests", "1");
var response = await httpClient.SendAsync(request);
}
}
require(httr)
headers = c(
`Upgrade-Insecure-Requests` = '1',
)
params = list(
`datatype` = 'json'
)
res <- httr::GET(url = 'https://financialmodelingprep.com/api/v3/profile/AAPL', httr::add_headers(.headers=headers), query = params)
version: 2
requests:
curl_converter:
request:
url: 'https://financialmodelingprep.com/api/v3/profile/AAPL'
method: GET
headers:
-
name: Upgrade-Insecure-Requests
value: '1'
-
queryString:
-
name: datatype
value: json
extern crate reqwest;
use reqwest::headers::*;
fn main() -> Result<(), reqwest::Error> {
let mut headers = HeaderMap::new();
headers.insert(UPGRADE_INSECURE_REQUESTS, "1".parse().unwrap());
let res = reqwest::Client::new()
.get("")
.headers(headers)
.send()?
.text()?;
println!("{}", res);
Ok(())
}
import PlaygroundSupport
import Foundation
let url = URL(string: "")
var request = URLRequest(url: url!)
request.addValue("application/json", forHTTPHeaderField: "Accept")
let task = URLSession.shared.dataTask(with: url!) { data, response, error in
guard error == nil else {
print(error!)
return
}
guard let data = data else {
print("Data is empty")
return
}
let json = try! JSONSerialization.jsonObject(with: data, options: [])
print(json)
}
task.resume()
PlaygroundPage.current.needsIndefiniteExecution = true
import scala.io.Source.fromURL
val json = fromURL("").mkString
print(json)