Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=api&page=817&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=api

Returns an array of strings in format "username" or "username/projectName"

Found 10974 results for "api"(1503ms)

memoryApiPolicymain.tsx10 matches

@xkonti•Updated 11 months ago
2import { markdownToHtml } from "https://esm.town/v/xkonti/markdownToHtml";
3
4export const getPolicy = (apiName: string, contactEmail: string, lastUpdated: string) => {
5 if (apiName == null || apiName === "") apiName = "Memory API";
6 if (contactEmail == null || contactEmail === "") throw new Error("Contact email must be specified");
7 if (lastUpdated == null || lastUpdated === "") throw new Error("The last updated date must be specified");
8 const body = markdownToHtml(
9 `# ${apiName} Privacy Policy
10Last Updated: ${lastUpdated}
11
12## 1. Introduction
13Welcome to ${apiName}. This privacy policy outlines our practices regarding the collection, use, and sharing of information through ${apiName}.
14
15## 2. Data Collection and Use
16${apiName} allows users to store, retrieve, list, and delete data. The data stored can be of any type as inputted by the user. We do not restrict or control the content of the data stored. ${apiName} serves as a public database accessible to anyone with an API key.
17
18## 3. User Restrictions
19${apiName} does not impose age or user restrictions. However, users are advised to consider the sensitivity of the information they share.
20
21## 4. Global Use
22Our API is accessible globally. Users from all regions can store and access data on ${apiName}.
23
24## 5. Data Management
25Given the nature of ${apiName}, there are no user accounts or user identification measures. The API operates like a public database where data can be added, viewed, and deleted by any user. Users should be aware that any data they input can be accessed, modified, or deleted by other users.
26
27## 6. Data Security
28${apiName} is protected by an API key; beyond this, there is no specific data security measure in place. Users should not store sensitive, personal, or confidential information using ${apiName}. We assume no responsibility for the security of the data stored.
29
30## 7. Third-Party Involvement
31The API code is run and data is stored by val.town. They act as a third-party service provider for ${apiName}.
32
33## 8. Changes to This Policy

companiesHousePublicDatamain.tsx4 matches

@aeaton•Updated 11 months ago
2 const url = new URL(req.url);
3 const path = url.searchParams.get("path");
4 const apiUrl = new URL(path, "https://api.company-information.service.gov.uk/");
5 const apiKey = Deno.env.get("companiesHouseApiKey");
6 const basicAuth = btoa(apiKey + ":");
7 const response = await fetch(apiUrl, {
8 headers: { Authorization: `Basic ${basicAuth}` },
9 });

pipedreammain.tsx2 matches

@stevekrouse•Updated 11 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=44";
2import { google } from "npm:googleapis";
3
4export async function getAccessToken(accountId: string, bearer = Deno.env.get("pipedream")) {
5 const response = await fetchJSON(
6 `https://api.pipedream.com/v1/accounts/${accountId}?include_credentials=1`,
7 { bearer },
8 );

pipedreamREADME.md3 matches

@stevekrouse•Updated 11 months ago
1# Pipedream helpers
2
3Pipedream offers an Accounts API to handle OAuth for you, automatically, and for free. [How to do it is covered in this guide](https://docs.val.town/integrations/google-sheets/#use-pipedreams-accounts-api).
4
5The helper functions below can make it easier to work with various Google API. For example, I used them like so to get all my free/busy times for this week from all my google calendars:
6
7```ts
37```
38
39In order for this to work you need to follow the instructions in [this guide](https://docs.val.town/integrations/google-sheets/#use-pipedreams-accounts-api) to save your pipedream API key into your [Val Town Environment Variables](/settings/environment-variables) under `pipedream`, then connect the google account you care about to Pipedream, and copy it's Pipedream "account id" into your val code. Let me know if you need any help by commenting on this val!
40
41Migrated from folder: Archive/pipedream

aqiREADME.md1 match

@yacosta738•Updated 11 months ago
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12

gptApiSchemaBuildermain.tsx3 matches

@xkonti•Updated 11 months ago
6 return zodToJsonSchema(schema, {
7 name: "schema",
8 target: "openApi3",
9 }).definitions.schema;
10}
61}
62
63export function getOpenApiSpec(
64 url: string,
65 title: string,
69) {
70 return {
71 openapi: "3.1.0",
72 info: {
73 title,

homelessREADME.md2 matches

@cameronpak•Updated 11 months ago
5At [OurTechnology](https://ourtechnology.co), we create technology solutions to empower and equip those who serve the homeless. We have a large data set of available resources in the US to aid in helping those experiencing homelessness find local resources, community, and support.
6
7This private (_but public to read_) API is used in our [ChatGPT Assistant, Homeless Services](https://chatg.pt/homeless-help).
8
9## Why a [ChatGPT Assistant](https://chatg.pt/homeless-help)?
15- The data set has been compiled together over the years and will continue to be updated as new techniques and partnerships make that possible.
16- We use [Typesense](typesense.org), a search as a service tool, to provide lightning fast search results for homeless resources near you.
17- This endpoint is created with [Hono](hono.dev) and is an incredibly easy way to create an API.
18
19## Contact OurTechnology

gameIdeaApiREADME.md1 match

@xkonti•Updated 11 months ago
4- The GPT using it: [Game Idea Exchange GPT](https://chatgpt.com/g/g-8fryVV9cU-game-idea-exchange)
5
6Migrated from folder: Tuts/XkontiTech/gameIdeaApi

testPostToMastodonmain.tsx1 match

@geraldo•Updated 11 months ago
3export function testPostToMastodon() {
4 let response = postToMastodon(
5 "https://floss.social/api/v1",
6 Deno.env.get("mastodonAccessToken"),
7 "🔴 Nueva página web del proyecto de investigación periodística #CrimenesdeOdio. Recogemos 101 casos actualizados con 103 víctimas mortales en el Estado español entre 1990 y 2020. 👉 http://crimenesdeodio.info",

chatmain.tsx1 match

@onixoni•Updated 11 months ago
3async function getOpenAI() {
4 // if you don't have a key, use our std library version
5 if (Deno.env.get("OPENAI_API_KEY") === undefined) {
6 const { OpenAI } = await import("https://esm.town/v/std/openai");
7 return new OpenAI();

daily-advice-app1 file match

@dcm31•Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
apiv1
papimark21