J2897 icon

API 'ping' test

J2897 | PRO | 06/18/26 09:44:40 AM UTC (Edited) | 0 ⭐ | 18331 👁️ | Never ⏰ | []
Python |

750 B

|

None

|

0 👍

/

0 👎

"""
API Checker
 
Sends a request to a free Ping endpoint and displays
the HTTP status code and ping result.
"""
 
import json
 
import requests
 
URL = "https://api.formatdock.com/v1/free/ping"
 
 
def main() -> None:
    try:
        response = requests.get(URL, timeout=10)
        response.raise_for_status()
 
        data = response.json()
 
        print(f"Status: {response.status_code}")
        print(f"Result: {data['result']}")
        print("Response:")
        print(json.dumps(data, indent=2, sort_keys=True))
    except requests.RequestException as exc:
        print(f"Request failed: {exc}")
    except (TypeError, ValueError, KeyError) as exc:
        print(f"Unexpected response: {exc}")
 
 
if __name__ == "__main__":
    main()

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  • john_shaw icon
    06/17/26 02:34:14 AM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    It hasn't made you any money, you silly little sausage...
     If it had, you wouldn't be spamming it all over my comments section begging people for money.
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎