# Where can I find the API docs of type X?

**URL:** <https://discourse.julialang.org/t/where-can-i-find-the-api-docs-of-type-x/68938>\
**Category:** New to Julia\
**Tags:** type\
**Created:** [September 29, 2021, 2:44pm UTC](https://discourse.julialang.org/t/where-can-i-find-the-api-docs-of-type-x/68938 "2021-09-29T14:44:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![whatsthecraic](https://avatars.discourse-cdn.com/v4/letter/w/7bcc69/32.png) [@whatsthecraic](https://discourse.julialang.org/u/whatsthecraic)\
**Post date:** [September 29, 2021, 2:44pm UTC](https://discourse.julialang.org/t/where-can-i-find-the-api-docs-of-type-x/68938/1 "2021-09-29T14:44:20Z")

</div>

Hi there,  
where can I find the API of a given class from the stdlib, e.g. what are the fields, methods and the hierarchy of a DataType ?

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [September 29, 2021, 3:26pm UTC](https://discourse.julialang.org/t/where-can-i-find-the-api-docs-of-type-x/68938/2 "2021-09-29T15:26:02Z")

</div>

In REPL you can write `? NameOfType` to read the docstring of that type. Many user facing types will have common usage examples and such there.

For package types, you can read the package docs, most often there’s a badge in the GitHub readme. For base types there’s the Julia docs ([e.g. arrays](https://docs.julialang.org/en/v1/base/arrays/)).

But because Julia is not OOP, you can’t have a complete documentation of the “methods of a type”.

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [September 29, 2021, 3:31pm UTC](https://discourse.julialang.org/t/where-can-i-find-the-api-docs-of-type-x/68938/3 "2021-09-29T15:31:03Z")

</div>

`methodswith`, `subtypes`, and `supertypes` are functions that you can use to explore a type.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [September 29, 2021, 3:44pm UTC](https://discourse.julialang.org/t/where-can-i-find-the-api-docs-of-type-x/68938/4 "2021-09-29T15:44:03Z")

</div>

Note that `methodswith` is not guaranteed to catch every method that applies. For instance

```julia
filter(a -> a.name===:^, methodswith(Int64))

```

doesn’t return the method that corresponds to `2^4`. Because that one is not specialized for `Int64` in source.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [September 29, 2021, 4:16pm UTC](https://discourse.julialang.org/t/where-can-i-find-the-api-docs-of-type-x/68938/5 "2021-09-29T16:16:02Z")

</div>

You could always check `filter(a -> a.name===:^, methodswith(Int64, supertypes = true))` instead, but that gets very unwieldy very quickly.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [September 29, 2021, 4:29pm UTC](https://discourse.julialang.org/t/where-can-i-find-the-api-docs-of-type-x/68938/6 "2021-09-29T16:29:34Z")

</div>

Yes. Depending on whether you count supertypes, `methodswith` will probably miss many methods that you would expect to be listed in the api for an OOP type, or list many that would not. It follows from the Julia principle of not overly constraining functions.
