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=1&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 2272 results for "api"(547ms)

handlermain.ts3 matches

@andrewtwist•Updated 25 mins ago
11
12 const body = await req.json();
13 const response = await fetch("https://api.anthropic.com/v1/messages", {
14 method: "POST",
15 headers: {
16 "Content-Type": "application/json",
17 "x-api-key":
18 "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",
19 "anthropic-version": "2023-06-01",
20 },

LicitacoesPNCPnew-file-6710.ts10 matches

@wenderaugusto15•Updated 31 mins ago
38 const dataFim = dataFinal || formatarData(hoje);
39
40 let apiUrl = "";
41
42 if (tipo === "contratos") {
43 // Endpoint de contratos (não exige modalidade)
44 apiUrl =
45 `https://pncp.gov.br/api/consulta/v1/contratos?dataInicial=${dataIni}&dataFinal=${dataFim}&pagina=${pagina}`;
46 if (cnpj) apiUrl += `&cnpjOrgao=${cnpj}`;
47 } else {
48 // Endpoint de contratações/licitações (exige modalidade)
49 apiUrl =
50 `https://pncp.gov.br/api/consulta/v1/contratacoes/publicacao?dataInicial=${dataIni}&dataFinal=${dataFim}&codigoModalidadeContratacao=${modalidade}&pagina=${pagina}`;
51 if (uf) apiUrl += `&uf=${uf}`;
52 if (cnpj) apiUrl += `&cnpj=${cnpj}`;
53 }
54
55 console.log("Buscando:", apiUrl);
56
57 const response = await fetch(apiUrl, {
58 headers: {
59 "Accept": "application/json",

x402-playgroundREADME.md8 matches

@stevekrouse•Updated 36 mins ago
4
5A demo app showing both sides of the [x402 protocol](https://www.x402.org/)
6(HTTP 402 payments) — a **buyer** that pays for APIs with USDC, and a **seller**
7that charges for an API endpoint. All powered by automatic micropayments on
8Base.
9
15| App | File | Role | Description |
16| ---------- | ------------ | ------------------ | ------------------------------------------------------------------ |
17| **Buyer** | `buyer.tsx` | Pays for APIs | Web UI that calls paid x402 endpoints using `@x402/fetch` |
18| **Seller** | `seller.tsx` | Charges for an API | Hono app with `@x402/hono` middleware protecting `GET /api/random` |
19
20Since both use the same wallet, calling the seller from the buyer sends $0.001
37
38 User->>Buyer: Click "Get Random Number"
39 Buyer->>SDK: paidFetch(seller/api/random)
40 SDK->>Seller: GET /api/random
41 Seller-->>SDK: 402 Payment Required
42 SDK->>Base: Sign USDC payment (EIP-3009)
115| Route | Description |
116| ------------- | ------------------------------------------------------------------- |
117| `/` | Homepage explaining the API and pricing |
118| `/api/random` | Paid endpoint — returns `{ random: Math.random() }` for $0.001 USDC |
119
120## Key Details
19 // CEPIM - Entidades sem fins lucrativos impedidas
20 const endpoint =
21 "https://api.portaldatransparencia.gov.br/api-de-dados/cepim";
22 const params = new URLSearchParams();
23 params.append("pagina", pagina);
32 headers: {
33 "Accept": "application/json",
34 "chave-api-dados": "30b0f79e369b2bed448da2b339af01bb",
35 },
36 });

proxyFornecedoresnew-file-5605.ts2 matches

@wenderaugusto15•Updated 1 hour ago
18
19 // Se não passar parâmetro, busca lista geral de sancionados
20 const endpoint = "https://api.portaldatransparencia.gov.br/api-de-dados/ceis";
21 const params = new URLSearchParams();
22 params.append("pagina", pagina);
32 headers: {
33 "Accept": "application/json",
34 "chave-api-dados": "30b0f79e369b2bed448da2b339af01bb"
35 }
36 });

Sciencenew-file-7043.ts4 matches

@jovenis•Updated 1 hour ago
6<meta name="viewport" content="width=device-width, initial-scale=1.0">
7<title>Alice & Isaac — Nervous System Challenge</title>
8<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700;9..144,900&family=DM+Sans:wght@400;600&display=swap" rel="stylesheet">
9<style>
10:root{--bg:#0b0e1a;--su:#131729;--ca:#1a1f35;--bo:#252b45;--ac:#6ee7f7;--a2:#f7a3e0;--go:#ffd97a;--gr:#6dffc8;--re:#ff6b8a;--tx:#e8ecff;--mu:#7a84b0}
293 {q:"Dopamine deficiency in the substantia nigra causes:",c:["Alzheimer's","Epilepsy","Parkinson's disease","Depression"],a:2,e:"Loss of dopamine-producing neurons in the substantia nigra disrupts basal ganglia motor circuits, causing tremors, rigidity, and difficulty initiating movement."},
294 {q:"When a neurotransmitter is released at a synapse, it:",c:["Travels through the axon","Crosses the cleft and binds post-synaptic receptors","Is destroyed by myelin","Travels backwards to the cell body"],a:1,e:"Action potentials trigger vesicles to release neurotransmitters into the synaptic cleft. They bind post-synaptic receptors, exciting or inhibiting the next neuron."},
295 {q:"Low serotonin levels are strongly linked to:",c:["Fast reflexes","Depression and mood disorders","Rapid eye movement only","Heart arrhythmia"],a:1,e:"Serotonin regulates mood, sleep, and appetite. SSRIs (antidepressants) block serotonin reuptake to keep more available. Most serotonin is made in the gut."},
296 {q:"Acetylcholine at the neuromuscular junction:",c:["Causes relaxation","Triggers muscle contraction","Blocks pain","Forms myelin"],a:1,e:"ACh depolarizes muscle cell membranes at neuromuscular junctions, triggering contraction. Nerve agents like sarin block this, causing paralysis."},
297 {q:"What is the primary role of glial cells?",c:["Generate faster action potentials","Support, nourish, insulate, and maintain neurons","Store memories","Produce endocrine hormones"],a:1,e:"Astrocytes provide nutrients; oligodendrocytes/Schwann cells make myelin; microglia are the brain's immune cells. Without glia, neurons couldn't survive."},
302 {q:"In the spinal cord, gray matter contains __ and white matter contains __:",c:["Myelin / cell bodies","Cell bodies and interneurons / myelinated axon tracts","Voluntary / involuntary neurons","They are identical"],a:1,e:"Gray matter (H-shaped) contains neuron cell bodies and interneurons. White matter contains myelinated axon tracts carrying signals up (sensory) and down (motor)."},
303 {q:"Ascending spinal tracts carry:",c:["Motor commands down to muscles","Sensory info up to the brain","Lateral reflex signals","Hypothalamic hormones"],a:1,e:"Ascending tracts carry sensory info (touch, temp, pain, proprioception) to the brain. Descending tracts carry motor commands. The spinothalamic tract carries pain and temperature."},
304 {q:"The blood-brain barrier (BBB) is formed by:",c:["A skull membrane","Tight junctions between brain capillary cells","Myelin around cranial nerves","The dura mater"],a:1,e:"The BBB's tight junctions block most bacteria, toxins, and drugs from entering the brain. Small lipid-soluble molecules (like alcohol) pass through easily."},
305 {q:"Which fluid cushions the brain and spinal cord?",c:["Synovial fluid","Interstitial fluid","Cerebrospinal fluid (CSF)","Lymph"],a:2,e:"CSF fills brain ventricles and surrounds the spinal cord, absorbing shock and removing waste. A spinal tap samples CSF to diagnose meningitis and other conditions."},
306 {q:"Multiple sclerosis (MS) attacks which structure?",c:["Neuron cell bodies","Myelin sheath in the CNS","Hippocampus","Dopamine receptors"],a:1,e:"MS is an autoimmune disease destroying CNS myelin, disrupting nerve conduction. Symptoms depend on which axons are affected — vision, weakness, numbness."},
315 {q:"Pain felt in a different location from the injury is called:",c:["Phantom pain","Referred pain","Neuropathic pain","Somatic pain"],a:1,e:"Referred pain occurs when nerves from different areas converge on the same spinal cord neurons. Classic: heart attack pain felt in the left arm or jaw."},
316 {q:"Which photoreceptors handle vision in dim light?",c:["Cones","Ganglion cells","Rods","Bipolar cells"],a:2,e:"Rods are highly light-sensitive and concentrated at the retinal periphery. You can sometimes see a faint star better by looking slightly off-center — using rod-rich periphery rather than cone-rich fovea."},
317 {q:"During which sleep stage do most vivid dreams occur?",c:["Deep slow-wave sleep","REM sleep; coordinated by the brainstem/pons","Stage 1; thalamus","Stage 3; occipital lobe"],a:1,e:"During REM, the brain is nearly as active as when awake. The pons coordinates rapid eye movements. The brainstem also temporarily paralyzes voluntary muscles during REM."},
318 {q:"How does caffeine counteract sleepiness?",c:["Destroys adenosine molecules","Blocks adenosine receptors so adenosine can't signal sleepiness","Speeds up adenosine production","Activates the sympathetic system"],a:1,e:"Adenosine accumulates while awake and causes drowsiness. Caffeine blocks its receptors. When caffeine wears off, built-up adenosine floods the receptors — causing the energy 'crash.'"},
319 {q:"The amygdala is most important for:",c:["Regulating breathing","Processing emotions especially fear, and tagging memories emotionally","Producing CSF","Controlling finger movements"],a:1,e:"The amygdala evaluates threats and triggers fear responses. It tags memories with emotional significance — overactive amygdala function is linked to anxiety and PTSD."},

untitled-5254main.ts2 matches

@wenderaugusto15•Updated 1 hour ago
18
19 const endpoint =
20 "https://api.portaldatransparencia.gov.br/api-de-dados/fornecedores";
21 const params = new URLSearchParams();
22 params.append("pagina", pagina);
36 headers: {
37 "Accept": "application/json",
38 "chave-api-dados": "294ddb9ad963e659d40dd34db4ae8c7a",
39 },
40 });

my-first-valcommuter_proxy.ts4 matches

@ktreilly•Updated 1 hour ago
17 try {
18 const [wRes, aqiRes] = await Promise.all([
19 safeFetch("https://api.weather.gov/gridpoints/OKX/35,35/forecast/hourly"),
20 safeFetch("https://api.waqi.info/feed/newyork/?token=demo"), // Use 'demo' or get a free token
21 ]);
22
69 // MTA
70 try {
71 const rtRes = await safeFetch("https://www.goodservice.io/api/routes/7");
72 const rtData = await rtRes.json();
73 const globalStatus = rtData.status.toUpperCase();
74 try {
75 const stRes = await safeFetch(
76 "https://www.goodservice.io/api/stations/724",
77 3000,
78 );

proxyContratosFornecedormain.ts2 matches

@wenderaugusto15•Updated 1 hour ago
24
25 const endpoint =
26 "https://api.portaldatransparencia.gov.br/api-de-dados/contratos";
27 const params = new URLSearchParams();
28 params.append("cnpjContratada", cnpj.replace(/\D/g, ""));
34 headers: {
35 "Accept": "application/json",
36 "chave-api-dados": "294ddb9ad963e659d40dd34db4ae8c7a",
37 },
38 });

x402-playgroundSLIDES.md11 matches

@stevekrouse•Updated 1 hour ago
1# What if you never had to get an API key ever again?
2
3---
71. Sign up to Val Town (or replit, lovable, vercel, etc)
82. Vibe coding gets you super far in minutes
93. You need an API key for Browserbase, OpenAI, S3, etc...
104. You spend 5-45min creating an account, adding payment...
115. Only to find it's the wrong API! Try again!
126. 90% of the time of making a vibe-coded-app is getting API keys!
13
14---
22 - SQLite
23 - IP-anonmyizer (discontinued)
24- Twitter API proxy
25- Clay API proxy
26- Push users towards free APIs
27
28---
30# The Dream
31
321. Show up to any API with cold hard cash
332. Immediately send micropayments to try stuff out
343. Open protocol > closed app store
872. Val Town creates for you (or imports) a crypto wallet
883. Val Town gives you some free pennies to play (but you can add more)
894. You vibe code an app in minutes, it uses half a dozen APIs
905. It works; the app is done. You never got any API keys.
91
92---
95
961. We need more sellers on x402. Why isn't there a gold rush? Anyone can proxy
97 any paid API onto here and make money.
982. We need to make the onramp easier. I know Stripe is working on it. Maybe
99 "Login with Stripe" or "Login with Coinbase" could be helpful?

myApi

@jfix•Updated 8 hours ago

NB2API1 file match

@zyloxtube•Updated 1 day ago
adhamvapi
AZAPI
Founder at AZAPI building AI-powered OCR and CAPTCHA automation solutions for digital verification and document processing. 🔗 Find out more: https://azapi.ai/