curl https://financialmodelingprep.com/api/v3/ratios/AAPL
{
"symbol" : "AAPL",
"ratios" : [ {
"date" : "2019-09-28",
"investmentValuationRatios" : {
"priceBookValueRatio" : "11.1154",
"priceToBookRatio" : "11.1154",
"priceToSalesRatio" : "3.8903",
"priceEarningsRatio" : "18.7109",
"receivablesTurnover" : "5.489",
"priceToFreeCashFlowsRatio" : "17.5607",
"priceToOperatingCashFlowsRatio" : "14.5863",
"priceCashFlowRatio" : "0",
"priceEarningsToGrowthRatio" : "0",
"priceSalesRatio" : "0",
"dividendYield" : "",
"enterpriseValueMultiple" : "1.7966762045884",
"priceFairValue" : "0"
},
"profitabilityIndicatorRatios" : {
"ebitperRevenue" : "0.25266552384174",
"ebtperEBIT" : "1",
"niperEBT" : "0.84056163195765",
"grossProfitMargin" : "0.37817768109035",
"operatingProfitMargin" : "1",
"pretaxProfitMargin" : "0.24572017188497",
"netProfitMargin" : "0.21238094505984",
"effectiveTaxRate" : "0.15943836804235",
"returnOnAssets" : "0.5848",
"returnOnEquity" : "0.6106",
"returnOnCapitalEmployed" : "0.2691",
"nIperEBT" : "0.84056163195765",
"eBTperEBIT" : "1",
"eBITperRevenue" : "0.25266552384174"
},
"operatingPerformanceRatios" : {
"receivablesTurnover" : "5.489",
"payablesTurnover" : "1.2542",
"inventoryTurnover" : "64.5433",
"fixedAssetTurnover" : "6.9606185456686",
"assetTurnover" : "0.76857223883066"
},
"liquidityMeasurementRatios" : {
"currentRatio" : "1.54",
"quickRatio" : "1.3844473032029",
"cashRatio" : "0.46202160464632",
"daysOfSalesOutstanding" : "-9.2636",
"daysOfInventoryOutstanding" : "64.2588",
"operatingCycle" : "",
"daysOfPayablesOutstanding" : "64.8648",
"cashConversionCycle" : ""
},
"debtRatios" : {
"debtRatio" : "0.3192",
"debtEquityRatio" : "1.194",
"longtermDebtToCapitalization" : "0.50361776241806",
"totalDebtToCapitalization" : "0.54422142191553",
"interestCoverage" : "0.0",
"cashFlowToDebtRatio" : "0.64222977037771",
"companyEquityMultiplier" : "3.7410043320661"
},
"cashFlowIndicatorRatios" : {
"operatingCashFlowPerShare" : "15.0267",
"freeCashFlowPerShare" : "12.94",
"cashPerShare" : "10.5773",
"payoutRatio" : "0.251",
"receivablesTurnover" : "5.489",
"operatingCashFlowSalesRatio" : "0.26670997101939",
"freeCashFlowOperatingCashFlowRatio" : "0.84875560231154",
"cashFlowCoverageRatios" : "0.64222977037771",
"shortTermCoverageRatios" : "4.2728448275862",
"capitalExpenditureCoverageRatios" : "6.6118151500715",
"dividendpaidAndCapexCoverageRatios" : "2.8191679531974",
"dividendPayoutRatio" : "0.25551976255972"
},
{..}]
}
URL url = new URL("undefined");
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 = "undefined";
$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: '/api/v3/ratios/AAPL',
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 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)
data = response.read().decode("utf-8")
return json.loads(data)
url = ("undefined")
print(get_jsonparsed_data(url))
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
url := "undefined"
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("undefined")
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"), "undefined"))
{
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/ratios/AAPL', httr::add_headers(.headers=headers), query = params)
version: 2
requests:
curl_converter:
request:
url: 'https://financialmodelingprep.com/api/v3/ratios/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("undefined")
.headers(headers)
.send()?
.text()?;
println!("{}", res);
Ok(())
}
import PlaygroundSupport
import Foundation
let url = URL(string: "undefined")
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("undefined").mkString
print(json)