GithubHelp home page GithubHelp logo

api's Introduction

API

APIs of mine

Responce times

Name of function Average responce time (ms)
Time difference 32.7
UNIX time 241.4
Ping 788.83

Time API

The time API is availible at https://trnck.dev/time

GET Parameters

Name Description Example
ts Current client timestamp (in ms) 1606995302000

Example responce

{
  "status":"success",
  "result":{
    "s":135,
    "ms":135022,
    "unix":1606995437022
  }
}

JS Implementation

const timestamp = Date.now();
fetch(`https://trnck.dev/time?ts=${timestamp}`).then(f => f.json()).then(f => {
  const nowstamp = Date.now()  
  console.table({adjusted: Math.round(f.result.ms - (nowstamp - timestamp) / 2), raw: f.result.ms})
})

Limitations

Due to the One Way Latency problem, there is no way to calculate the exact time that passes between the client and the server.

Ping API

The ping API is availible at https://api.trnck.dev/ping

An API to ping a URL or IP adress, accepts any URL

GET Parameters

Name Description Example
url URL to ping https://taskord.com

Example responce

{
  "status": "success",
  "result": {
    "miliseconds": 404,
    "code": 200
  }
}

HTTP status mock API

A simle API for making the server respond with a certain status code

GET Parameters

Name Type Description Example
code int Status code to mock 418

Example request

https://api.trnck.dev/http/418

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.