Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/iamllcoolray/free-dictionary-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/iamllcoolray/free-dictionary-api

  • v0.0.0-20220616122441-dd5180046e1f
  • Source
  • Go
  • Socket score

Version published
Created
Source

Free Dictionary API

Description

The Free Dictionary API wrapper written in Go.

Usage

Installation

go get github.com/iamllcoolray/free-dictionary-api

Getting Started

import "github.com/iamllcoolray/free-dictionary-api"

func main() {
	dictionary, err := dictionaryapi.Get("hello")
	if err != nil {
		log.Fatal(err)
	}

    // Prints out an `Uglier` JSON response
	// Can be indexed
	fmt.Printf("%+v\n", dictionary)

	// A function that make the JSON response `Prettier`
	// Cannot be indexed
	fmt.Println(dictionaryapi.PrettierParseResponse(dictionary))

	// A terrible way to get specific JSON responses
	// Will implement a better way soon
	fmt.Printf("Word: %+v\n", dictionary[0].Word)
	fmt.Printf("Phonetic: %+v\n", dictionary[0].Phonetic)
	fmt.Printf("Phonetics/Text: %+v\n", dictionary[0].Phonetics[0].Text)
	fmt.Printf("Phonetics/Audio: %+v\n", dictionary[0].Phonetics[0].Audio)
	fmt.Printf("Origin: %+v\n", dictionary[0].Origin)
	fmt.Printf("Meanings/Part of Speech: %+v\n", dictionary[0].Meanings[0].PartOfSpeech)
	fmt.Printf("Meanings/Definition: %+v\n", dictionary[0].Meanings[0].Definitions[0].Definition)
	fmt.Printf("Meanings/Example: %+v\n", dictionary[0].Meanings[0].Definitions[0].Example)
	fmt.Printf("Meanings/Synonyms: %+v\n", dictionary[0].Meanings[0].Definitions[0].Synonyms)
	fmt.Printf("Meanings/Antonyms: %+v\n", dictionary[0].Meanings[0].Definitions[0].Antonyms)
}

Issues

Need to make an easy/efficient way to grab specific data from the api call.

FAQs

Package last updated on 16 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc