Edits history of script submission #322 for ' Latest exchange rate from CurrencyApi.com (currencyapi)'

  • deno
    type Currencyapi = {
      apiKey: string;
    };
    export async function main(
      currencyApiResource: Currencyapi,
      base_currency: string,
      currencies: string,
    ) {
      const paramString = new URLSearchParams({
        base_currency: base_currency,
        currencies: currencies,
      }).toString();
    
      const res = await fetch(
        `https://api.currencyapi.com/v3/latest?${paramString}`,
        {
          headers: {
            apikey: currencyApiResource.apiKey,
          },
        },
      );
      const data = await res.json();
      const currency = data?.data;
      return currency;
    }
    

    Submitted by hugo697 399 days ago

  • deno
    type Currencyapi = {
      apiKey: string;
    };
    export async function main(
      currencyApiResource: Currencyapi,
      base_currency: string,
      currencies: string,
    ) {
      const paramString = new URLSearchParams({
        base_currency: base_currency,
        currencies: currencies,
      }).toString();
    
      const res = await fetch(
        `https://api.currencyapi.com/v3/latest?${paramString}`,
        {
          headers: {
            apikey: currencyApiResource.apiKey,
          },
        },
      );
      const data = await res.json();
      const currency = data?.data;
      return currency;
    }
    

    Submitted by admin 1031 days ago

  • deno
    
    type Currencyapi = {
      apiKey: string;
    };
    export async function main(
      currencyApiResource: Currencyapi,
      base_currency: string,
      currencies: string,
    ) {
      const paramString = new URLSearchParams({
        base_currency: base_currency,
        currencies: currencies,
      }).toString();
    
      const res = await fetch(
        `https://api.currencyapi.com/v3/latest?${paramString}`,
        {
          headers: {
            apikey: currencyApiResource.apiKey,
          },
        },
      );
      const data = await res.json();
      const currency = data?.data;
      return currency;
    }

    Submitted by admin 1034 days ago

  • deno
    import type { Resource } from "https://deno.land/x/[email protected]/mod.ts"
    
    export async function main(
      currencyApiResource: Resource<"currencyapi">,
      base_currency: string,
      currencies: string,
    ) {
      const paramString = new URLSearchParams({
        base_currency: base_currency,
        currencies: currencies,
      }).toString();
    
      const res = await fetch(
        `https://api.currencyapi.com/v3/latest?${paramString}`,
        {
          headers: {
            apikey: currencyApiResource.apiKey,
          },
        },
      );
      const data = await res.json();
      const currency = data?.data;
      return currency;
    }

    Submitted by rubenfiszel 1154 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    export async function main(
      currencyApiResource: wmill.Resource<"currencyapi">,
      base_currency: string,
      currencies: string,
    ) {
      const paramString = new URLSearchParams({
        base_currency: base_currency,
        currencies: currencies,
      }).toString();
    
      const res = await fetch(
        `https://api.currencyapi.com/v3/latest?${paramString}`,
        {
          headers: {
            apikey: currencyApiResource.apiKey,
          },
        },
      );
      const data = await res.json();
      const currency = data?.data;
      return currency;
    }

    Submitted by rubenfiszel 1154 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    export async function main(
      currencyApiResource: wmill.Resource<"currencyapi">,
      base_currency: string,
      currencies: string,
    ) {
      const paramString = new URLSearchParams({
        base_currency: base_currency,
        currencies: currencies,
      }).toString();
    
      const res = await fetch(
        `https://api.currencyapi.com/v3/latest?${paramString}`,
        {
          headers: {
            apikey: currencyApiResource.apikey,
          },
        },
      );
      const data = await res.json();
      const currency = data?.data;
      return currency;
    }

    Submitted by sindre svendby964 1154 days ago