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=867&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"(1018ms)

gpt3Examplemain.tsx2 matches

@ktodaz•Updated 1 year ago
2
3const gpt3Example = async () => {
4 const response = await fetch("https://api.openai.com/v1/completions", {
5 method: "POST",
6 headers: {
7 "Content-Type": "application/json",
8 "Authorization": "Bearer " + process.env.OPENAI_API_KEY, // Replace with your OpenAI API Key
9 },
10 body: JSON.stringify({

untitled_sapphireSlugmain.tsx2 matches

@lolocoo•Updated 1 year ago
1const googleSearchKey = "AIzaSyAY7rS9VJVEcS6196uOWXOx2mCq_cN2kXM";
2const googleCxId = "70c6ff0b41f6943a4";
3const baseurl = "https://www.googleapis.com/customsearch/v1";
4
5export default async function(req: Request): Promise<Response> {
14 try {
15 const data = await fetch(
16 `https://www.googleapis.com/customsearch/v1?q=${searchKey}&cx=70c6ff0b41f6943a4&key=AIzaSyAY7rS9VJVEcS6196uOWXOx2mCq_cN2kXM&c2coff=1&start=1&num=5&dateRestrict=m%5B1%5D`,
17 )
18 .then(response => response.json())

googlesearchmain.tsx2 matches

@lolocoo•Updated 1 year ago
5const googleCxId = "70c6ff0b41f6943a4";
6
7const baseurl = "https://www.googleapis.com/customsearch/v1";
8
9export const getGoogleSearch = async ({ searchKey }) => {
25
26 const getSearch = async (data) => {
27 const response = await fetch("https://api.openai.com/v1/completions", {
28 method: "GET",
29 body: JSON.stringify(data),

untitled_amberLeopardmain.tsx1 match

@stevekrouse•Updated 1 year ago
3export default async function(req: Request): Promise<Response> {
4 const plugin = await createPlugin(
5 "https://cdn.modsurfer.dylibso.com/api/v1/module/ec17c9afde08aa9e7fa857fe2c9cbb9206e3a3dbec98429ceebd3421de7070da.wasm",
6 { useWasi: false },
7 );

untitled_tanHareREADME.md1 match

@vez•Updated 1 year ago
7To use it on your own Val Town Blob Storage, [fork it](https://www.val.town/v/stevekrouse/blob_admin/fork) to your account.
8
9It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
10
11# TODO

appendToCommentsmain.tsx1 match

@coreyallen•Updated 1 year ago
2
3export const appendToComments = (
4 // the Run API accepts any number of JSON-encoded args
5 // here we accept a single arg
6 data: any,
33 const getScores = async (week: number) => {
34 const { data } = await axios.get(
35 "http://site.api.espn.com/apis/site/v2/sports/football/nfl/scoreboard",
36 );
37 let standings = getStandings();

twitterSearchmain.tsx1 match

@jplhomer•Updated 1 year ago
14}): Promise<TweetResult[]> {
15 const { data } = await twitterJSON({
16 url: `https://api.twitter.com/2/tweets/search/recent?query=${await searchParams(
17 {
18 query,

watch_bilibili_videomain.tsx1 match

@rebelpotato•Updated 1 year ago
5}
6
7const watch_video_url = "http://api.bilibili.com/x/v2/history/report";
8
9// watch a bilibili video for a random time less than its duration

zohoDeskApiREADME.md5 matches

@julbrs•Updated 1 year ago
1# Zoho Desk API
2
3A set of method to easily grab information on Zoho Desk! Official API Documentation is [here](https://desk.zoho.com/DeskAPIDocument).
4
5## Notes
6
7It's needed to create a Self Client Application as described [here](https://desk.zoho.com/DeskAPIDocument#OauthTokens#RegisteringAClient) to use this val. You also need to find your org id (under Setup > API > Zoho Service Communication (ZSC) Key > OrgId).
8
9## Methods
11As of today here is the methods in this val:
12
13- `refreshAccessToken` to generate a valid Access Token based on client id, client secret and a refresh token. Follow the step [here](https://desk.zoho.com/DeskAPIDocument#OauthTokens#RegisteringAClient) to register a client and generate a refresh token.
14- `notAssignedTickets` to extract the currently not assigned tickets in a specified department
15
16Migrated from folder: zohoDesk/zohoDeskApi

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