Skip to content

注文支払額の見積もり V3 ​

TIP

API エンドポイント ​

shell
GET /v3/order/price

リクエストパラメータ ​

項目指定箇所型必須説明
resource_typequeryintegertrueリソース種別:0 は帯域幅、1 はエネルギー
resource_valuequeryintegertrueレンタルするリソース量

API レスポンス ​

項目型必須説明
codeintegertrueステータスコード
msgstringtrueステータスの説明
request_idstringtrue
dataobjecttrue
» resource_valueintegertrueレンタルするリソース量
» pay_amountnumbertrue支払額
» service_amountnumbertrue手数料(支払額に含まれます)
» rent_durationintegertrue5 分で固定
» rent_time_unitstringtruem で固定
» rent_time_secondintegertrue300 秒で固定
» price_in_sunnumbertrueリソース単価

レスポンス例 ​

json
{
    "code": 0,
    "msg": "ok",
    "request_id": "d30e5f5c-21c1-4975-a982-de3169dd0959",
    "data": {
        "resource_value": 32000,
        "pay_amount": 4.4,
        "service_amount": 0.56,
        "rent_duration": 5,
        "rent_time_unit": "m",
        "rent_time_second": 300,
        "price_in_sun": 120
    }
}

コード例 ​

Shell ​

shell
curl --location --request GET 'https://feee.io/open/v3/order/price?resource_value=<resource_value>' \
--header 'key: <key>' \
--header 'User-Agent: Feee.io Shell Client/1.0.0 (https://feee.io)'

Golang ​

go
package main

import (
   "fmt"
   "net/http"
   "io/ioutil"
)

func main() {

   url := "https://feee.io/open/v3/order/price?resource_value=<resource_value>"
   method := "GET"

   client := &http.Client {
   }
   req, err := http.NewRequest(method, url, nil)

   if err != nil {
      fmt.Println(err)
      return
   }
   req.Header.Add("key", "<key>")
   req.Header.Add("User-Agent", "Feee.io Golang Client/1.0.0 (https://feee.io)")

   res, err := client.Do(req)
   if err != nil {
      fmt.Println(err)
      return
   }
   defer res.Body.Close()

   body, err := ioutil.ReadAll(res.Body)
   if err != nil {
      fmt.Println(err)
      return
   }
   fmt.Println(string(body))
}

PHP ​

php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://feee.io/open/v3/order/price?resource_value=<resource_value>',
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_ENCODING => '',
   CURLOPT_MAXREDIRS => 10,
   CURLOPT_TIMEOUT => 0,
   CURLOPT_FOLLOWLOCATION => true,
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
   CURLOPT_CUSTOMREQUEST => 'GET',
   CURLOPT_HTTPHEADER => array(
      'key: <key>',
      'User-Agent: Feee.io PHP Client/1.0.0 (https://feee.io)'
   ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Python ​

python
import http.client

conn = http.client.HTTPSConnection("feee.io")
payload = ''
headers = {
   'key': '<key>',
   'User-Agent': 'Feee.io Python Client/1.0.0 (https://feee.io)'
}
conn.request("GET", "/open/v3/order/price?resource_value=<resource_value>", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Java ​

java
OkHttpClient client = new OkHttpClient().newBuilder()
   .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
   .url("https://feee.io/open/v3/order/price?resource_value=<resource_value>")
   .method("GET", body)
   .addHeader("key", "<key>")
   .addHeader("User-Agent", "Feee.io Java Client/1.0.0 (https://feee.io)")
   .build();
Response response = client.newCall(request).execute();