Documentation

​
​

Development

User Acquisition

Monetization

Industry

Cloud Code

Scripting API

Services C# SDKs

Services JavaScript SDKs

Admin REST API

Client REST API

Scheduler Admin REST API

Observability REST API

Open Unity Dashboard

Cloud Code

LiveOps
​
​
Cloud Code
  • Overview
  • Get started
  • Server authority
  • Cloud Code C# modules
  • Cloud Code JavaScript scripts
    • Overview
    • Get started
    • Concepts
    • Tutorials
      • Run scripts
      • Write scripts
      • Interact with cross-player data
      • Integrate with CI/CD
      • Use Access Control
      • Test run a script
      • Integrate with other Unity Services
      • Integrate with external services
      • Use Cases
    • Reference
  • Logging
  • Use-case samples
  • Privacy and consent
  1. Cloud Code

Integrate with external services

Call public internet endpoints and public APIs from your Cloud Code scripts.
Read time 1 minute
Last updated 9 months ago

With Cloud Code, you can call out to any public internet endpoint, including the public APIs that are a part of UGS.
The following example demonstrates how to call out to a Cat Facts API to get a random cat fact.
JavaScript
const axios = require("axios-0.21");module.exports = async ({ params, context, logger }) => { let result; try { const catFactUrl = `https://catfact.ninja/fact`; result = await axios.get(catFactUrl); return result.data; } catch (err) { logger.error("Failed to call out to Cat Facts", {"error.message": err.message}); throw err; }};
For more information, learn how to integrate with other Unity services.

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • JavaScript


Report a problem with this page